From 71516c5c5c280ffbfdd04efb6eb5a2112a41436b Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Tue, 24 Jun 2025 12:35:40 -0700 Subject: [PATCH 01/43] add planetary computer sdk for dotnet --- ...zure.ResourceManager.PlanetaryComputer.sln | 56 ++ .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 111 +++ ...esourceManager.PlanetaryComputer.net8.0.cs | 213 ++++++ ...anager.PlanetaryComputer.netstandard2.0.cs | 213 ++++++ .../assets.json | 8 + ...ceManager.PlanetaryComputer.Samples.csproj | 13 + .../Generated/Samples/GeneratedSamples.csproj | 21 + .../Samples/Sample_GeoCatalogCollection.cs | 212 +++++ .../Samples/Sample_GeoCatalogResource.cs | 122 +++ .../Sample_SubscriptionResourceExtensions.cs | 50 ++ ...e.ResourceManager.PlanetaryComputer.csproj | 8 + .../ArmPlanetaryComputerModelFactory.cs | 56 ++ .../MockablePlanetaryComputerArmClient.cs | 49 ++ ...ePlanetaryComputerResourceGroupResource.cs | 105 +++ ...lePlanetaryComputerSubscriptionResource.cs | 102 +++ .../Extensions/PlanetaryComputerExtensions.cs | 219 ++++++ .../src/Generated/GeoCatalogCollection.cs | 499 ++++++++++++ .../Generated/GeoCatalogData.Serialization.cs | 196 +++++ .../src/Generated/GeoCatalogData.cs | 87 +++ .../GeoCatalogResource.Serialization.cs | 26 + .../src/Generated/GeoCatalogResource.cs | 707 +++++++++++++++++ .../src/Generated/Internal/Argument.cs | 129 ++++ .../Internal/ChangeTrackingDictionary.cs | 167 ++++ .../Generated/Internal/ChangeTrackingList.cs | 153 ++++ .../Internal/ModelSerializationExtensions.cs | 399 ++++++++++ .../src/Generated/Internal/Optional.cs | 51 ++ .../Internal/Utf8JsonRequestContent.cs | 55 ++ .../GeoCatalogOperationSource.cs | 36 + .../PlanetaryComputerArmOperation.cs | 94 +++ .../PlanetaryComputerArmOperationOfT.cs | 100 +++ .../AutoGeneratedDomainNameLabelScope.cs | 57 ++ .../src/Generated/Models/CatalogTier.cs | 48 ++ .../GeoCatalogListResult.Serialization.cs | 151 ++++ .../Generated/Models/GeoCatalogListResult.cs | 80 ++ .../Models/GeoCatalogPatch.Serialization.cs | 159 ++++ .../src/Generated/Models/GeoCatalogPatch.cs | 70 ++ .../GeoCatalogProperties.Serialization.cs | 174 +++++ .../Generated/Models/GeoCatalogProperties.cs | 77 ++ .../Models/ManagedServiceIdentityType.cs | 57 ++ ...agedServiceIdentityUpdate.Serialization.cs | 160 ++++ .../Models/ManagedServiceIdentityUpdate.cs | 71 ++ .../src/Generated/Models/ProvisioningState.cs | 66 ++ .../src/Generated/ProviderConstants.cs | 16 + .../GeoCatalogsRestOperations.cs | 723 ++++++++++++++++++ .../src/Properties/AssemblyInfo.cs | 11 + ...urceManager.PlanetaryComputer.Tests.csproj | 8 + .../PlanetaryComputerManagementTestBase.cs | 45 ++ ...netaryComputerManagementTestEnvironment.cs | 11 + .../Scenario/GeoCatalogCollectionTests.cs | 219 ++++++ .../tests/test-resources.json | 7 + .../tests/test.runsettings | 8 + .../tsp-location.yaml | 4 + sdk/planetarycomputer/ci.mgmt.yml | 30 + sdk/resourcemanager/ci.mgmt.yml | 2 + 56 files changed, 6528 insertions(+) create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer.sln create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Directory.Build.props create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Azure.ResourceManager.PlanetaryComputer.Samples.csproj create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/GeneratedSamples.csproj create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogCollection.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogResource.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Azure.ResourceManager.PlanetaryComputer.csproj create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ArmPlanetaryComputerModelFactory.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerArmClient.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerResourceGroupResource.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerSubscriptionResource.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogCollection.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.Serialization.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Argument.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Optional.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperation.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperationOfT.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/CatalogTier.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.Serialization.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.Serialization.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityType.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ProvisioningState.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ProviderConstants.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/RestOperations/GeoCatalogsRestOperations.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Azure.ResourceManager.PlanetaryComputer.Tests.csproj create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestBase.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestEnvironment.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test-resources.json create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test.runsettings create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml create mode 100644 sdk/planetarycomputer/ci.mgmt.yml diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer.sln b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer.sln new file mode 100644 index 000000000000..9e3d18da7378 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.PlanetaryComputer.Samples", "samples\Azure.ResourceManager.PlanetaryComputer.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.PlanetaryComputer", "src\Azure.ResourceManager.PlanetaryComputer.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.PlanetaryComputer.Tests", "tests\Azure.ResourceManager.PlanetaryComputer.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes \ No newline at end of file diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Directory.Build.props b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md new file mode 100644 index 000000000000..a99b562d5edd --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -0,0 +1,111 @@ +# Microsoft Azure PlanetaryComputer Management Client Library for .NET + +The `Azure.ResourceManager.PlanetaryComputer` SDK is the **.NET Management Plane SDK** for working with `GeoCatalog` resources under the **PlanetaryComputer** service. + +It supports full **CRUD operations**, as well as **recorded** and **playback testing** using the Azure SDK's standard test framework. + +--- + +## ๐Ÿ“ Project Structure + +``` +sdk/ +โ””โ”€โ”€ planetarycomputer/ + โ””โ”€โ”€ Azure.ResourceManager.PlanetaryComputer/ + โ”œโ”€โ”€ src/ # Generated SDK source code + โ”œโ”€โ”€ tests/ + โ”‚ โ”œโ”€โ”€ Scenario/ + โ”‚ โ”‚ โ””โ”€โ”€ GeoCatalogCollectionTests.cs # Main scenario tests + โ”‚ โ”œโ”€โ”€ PlanetaryComputerManagementTestBase.cs # Base test infrastructure + โ”‚ โ””โ”€โ”€ PlanetaryComputerManagementTestEnvironment.cs + โ”œโ”€โ”€ Azure.ResourceManager.PlanetaryComputer.csproj + โ”œโ”€โ”€ Azure.ResourceManager.PlanetaryComputer.Tests.csproj + โ””โ”€โ”€ assets.json # Required for test recording/playback +``` + +--- + +## ๐Ÿš€ Getting Started + +### ๐Ÿ“ฆ Install the Package + +Install the package via [NuGet](https://www.nuget.org/): + +```bash +dotnet add package Azure.ResourceManager.PlanetaryComputer --prerelease +``` + +--- + +## ๐Ÿ› ๏ธ Prerequisites + +- [.NET SDK 8.0+](https://dotnet.microsoft.com/download) +- [Azure SDK Test Proxy](https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md) + ```bash + dotnet tool install --global Azure.Sdk.Tools.TestProxy + ``` +- Logged in to Azure CLI: + ```bash + az login + ``` +- Set the following environment variables for test execution: + +```bash +$env:AZURE_SUBSCRIPTION_ID = "" +$env:AZURE_TEST_MODE = "Record" # or "Playback" +$env:AZURE_AUTHORITY_HOST = "https://login.microsoftonline.com" +``` + +--- + +## โœ… Supported Tests + +| Test Name | Description | +|----------------------------------|---------------------------------------------| +| `CreateGeoCatalog` | Creates a GeoCatalog | +| `UpdateGeoCatalog` | Updates an existing GeoCatalog | +| `DeleteGeoCatalog` | Deletes a GeoCatalog | +| `GetGeoCatalog` | Retrieves a specific GeoCatalog | +| `ListGeoCatalogsInResourceGroup`| Lists GeoCatalogs in a resource group | +| `ListGeoCatalogsBySubscription` | Lists GeoCatalogs under a subscription | +| `CreateUpdateDeleteGeoCatalog` | Full CRUD scenario combined | + +--- + +## ๐Ÿงช Running Tests + +### โ–ถ๏ธ Record Mode (Live with Azure) + +1. Start the test proxy: + ```bash + test-proxy + ``` +2. Set mode: + ```bash + $env:AZURE_TEST_MODE = "Record" + ``` +3. Run a specific test: + ```bash + dotnet test -f net8.0 --filter "Name=CreateUpdateDeleteGeoCatalog" + ``` +4. Recordings are saved to: + ``` + .azure-sdk-for-net/.assets//net/sdk/PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer/tests/SessionRecords + ``` + +--- + +### โฏ๏ธ Playback Mode (Offline Testing) + +1. Set mode: + ```bash + $env:AZURE_TEST_MODE = "Playback" + ``` +2. (Optional) Restore recordings: + ```bash + test-proxy restore -a ./assets.json + ``` +3. Run test: + ```bash + dotnet test -f net8.0 --filter "Name=CreateUpdateDeleteGeoCatalog" + ``` diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs new file mode 100644 index 000000000000..155bf5e2eb3d --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs @@ -0,0 +1,213 @@ +namespace Azure.ResourceManager.PlanetaryComputer +{ + public partial class GeoCatalogCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected GeoCatalogCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.GeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.GeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class GeoCatalogData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GeoCatalogData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GeoCatalogResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected GeoCatalogResource() { } + public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string catalogName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class PlanetaryComputerExtensions + { + public static Azure.Response GetGeoCatalog(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetGeoCatalogAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogResource GetGeoCatalogResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogCollection GetGeoCatalogs(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetGeoCatalogs(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetGeoCatalogsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.PlanetaryComputer.Mocking +{ + public partial class MockablePlanetaryComputerArmClient : Azure.ResourceManager.ArmResource + { + protected MockablePlanetaryComputerArmClient() { } + public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogResource GetGeoCatalogResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockablePlanetaryComputerResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockablePlanetaryComputerResourceGroupResource() { } + public virtual Azure.Response GetGeoCatalog(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetGeoCatalogAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogCollection GetGeoCatalogs() { throw null; } + } + public partial class MockablePlanetaryComputerSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockablePlanetaryComputerSubscriptionResource() { } + public virtual Azure.Pageable GetGeoCatalogs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetGeoCatalogsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + public static partial class ArmPlanetaryComputerModelFactory + { + public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogData GeoCatalogData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties GeoCatalogProperties(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier? tier = default(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier?), string catalogUri = null, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState?), Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope?)) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoGeneratedDomainNameLabelScope : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoGeneratedDomainNameLabelScope(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope NoReuse { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope ResourceGroupReuse { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope SubscriptionReuse { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope TenantReuse { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CatalogTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CatalogTier(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier Basic { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier right) { throw null; } + public override string ToString() { throw null; } + } + public partial class GeoCatalogPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GeoCatalogPatch() { } + public Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate Identity { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GeoCatalogProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GeoCatalogProperties() { } + public Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } + public string CatalogUri { get { throw null; } } + public Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier? Tier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedServiceIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedServiceIdentityType(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType None { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType SystemAssigned { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType SystemAssignedUserAssigned { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType left, Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType left, Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ManagedServiceIdentityUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedServiceIdentityUpdate() { } + public Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType? Type { get { throw null; } set { } } + public System.Collections.Generic.IDictionary UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs new file mode 100644 index 000000000000..155bf5e2eb3d --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs @@ -0,0 +1,213 @@ +namespace Azure.ResourceManager.PlanetaryComputer +{ + public partial class GeoCatalogCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected GeoCatalogCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.GeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.GeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class GeoCatalogData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GeoCatalogData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GeoCatalogResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected GeoCatalogResource() { } + public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string catalogName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class PlanetaryComputerExtensions + { + public static Azure.Response GetGeoCatalog(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetGeoCatalogAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogResource GetGeoCatalogResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogCollection GetGeoCatalogs(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetGeoCatalogs(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetGeoCatalogsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.PlanetaryComputer.Mocking +{ + public partial class MockablePlanetaryComputerArmClient : Azure.ResourceManager.ArmResource + { + protected MockablePlanetaryComputerArmClient() { } + public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogResource GetGeoCatalogResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockablePlanetaryComputerResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockablePlanetaryComputerResourceGroupResource() { } + public virtual Azure.Response GetGeoCatalog(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetGeoCatalogAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogCollection GetGeoCatalogs() { throw null; } + } + public partial class MockablePlanetaryComputerSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockablePlanetaryComputerSubscriptionResource() { } + public virtual Azure.Pageable GetGeoCatalogs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetGeoCatalogsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + public static partial class ArmPlanetaryComputerModelFactory + { + public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogData GeoCatalogData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties GeoCatalogProperties(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier? tier = default(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier?), string catalogUri = null, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState?), Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope?)) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoGeneratedDomainNameLabelScope : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoGeneratedDomainNameLabelScope(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope NoReuse { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope ResourceGroupReuse { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope SubscriptionReuse { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope TenantReuse { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CatalogTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CatalogTier(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier Basic { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier right) { throw null; } + public override string ToString() { throw null; } + } + public partial class GeoCatalogPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GeoCatalogPatch() { } + public Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate Identity { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GeoCatalogProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GeoCatalogProperties() { } + public Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } + public string CatalogUri { get { throw null; } } + public Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier? Tier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedServiceIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedServiceIdentityType(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType None { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType SystemAssigned { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType SystemAssignedUserAssigned { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType left, Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType left, Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ManagedServiceIdentityUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedServiceIdentityUpdate() { } + public Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType? Type { get { throw null; } set { } } + public System.Collections.Generic.IDictionary UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json new file mode 100644 index 000000000000..32f3501ad879 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json @@ -0,0 +1,8 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer", + "Tag": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer_0827ee99b3", + "ServiceDirectory": "planetarycomputer", + "SessionRecordsDirectory": "SessionRecords" + } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Azure.ResourceManager.PlanetaryComputer.Samples.csproj b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Azure.ResourceManager.PlanetaryComputer.Samples.csproj new file mode 100644 index 000000000000..9afe1f52866d --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Azure.ResourceManager.PlanetaryComputer.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/GeneratedSamples.csproj b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/GeneratedSamples.csproj new file mode 100644 index 000000000000..7ee7af72add3 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/GeneratedSamples.csproj @@ -0,0 +1,21 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + + + + + + + + diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogCollection.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogCollection.cs new file mode 100644 index 000000000000..cdc6996c9ae2 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogCollection.cs @@ -0,0 +1,212 @@ +// 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.Models; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.PlanetaryComputer.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.PlanetaryComputer.Samples +{ + public partial class Sample_GeoCatalogCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_GeoCatalogsCreate() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Create.json + // this example is just showing the usage of "GeoCatalog_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GeoCatalogResource + GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + + // invoke the operation + string catalogName = "MyCatalog"; + GeoCatalogData data = new GeoCatalogData(new AzureLocation("eastus")) + { + Properties = new GeoCatalogProperties + { + Tier = CatalogTier.Basic, + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.NoReuse, + }, + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/ac9a1867-7476-4346-bf8b-968370fe212c/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity")] = new UserAssignedIdentity() +}, + }, + Tags = +{ +["MyTag"] = "MyValue" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + GeoCatalogResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GeoCatalogsGet() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json + // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GeoCatalogResource + GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + + // invoke the operation + string catalogName = "MyCatalog"; + GeoCatalogResource result = await collection.GetAsync(catalogName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_GeoCatalogsListByResourceGroup() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_ListByResourceGroup.json + // this example is just showing the usage of "GeoCatalog_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GeoCatalogResource + GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + + // invoke the operation and iterate over the result + await foreach (GeoCatalogResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GeoCatalogsGet() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json + // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GeoCatalogResource + GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + + // invoke the operation + string catalogName = "MyCatalog"; + bool result = await collection.ExistsAsync(catalogName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GeoCatalogsGet() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json + // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GeoCatalogResource + GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + + // invoke the operation + string catalogName = "MyCatalog"; + NullableResponse response = await collection.GetIfExistsAsync(catalogName); + GeoCatalogResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogResource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogResource.cs new file mode 100644 index 000000000000..34ace5aac654 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogResource.cs @@ -0,0 +1,122 @@ +// 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.Models; +using Azure.ResourceManager.PlanetaryComputer.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.PlanetaryComputer.Samples +{ + public partial class Sample_GeoCatalogResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GeoCatalogsGet() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json + // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this GeoCatalogResource created on azure + // for more information of creating GeoCatalogResource, please refer to the document of GeoCatalogResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + string catalogName = "MyCatalog"; + ResourceIdentifier geoCatalogResourceId = GeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); + GeoCatalogResource geoCatalog = client.GetGeoCatalogResource(geoCatalogResourceId); + + // invoke the operation + GeoCatalogResource result = await geoCatalog.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_GeoCatalogsDelete() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Delete.json + // this example is just showing the usage of "GeoCatalog_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this GeoCatalogResource created on azure + // for more information of creating GeoCatalogResource, please refer to the document of GeoCatalogResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + string catalogName = "MyCatalog"; + ResourceIdentifier geoCatalogResourceId = GeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); + GeoCatalogResource geoCatalog = client.GetGeoCatalogResource(geoCatalogResourceId); + + // invoke the operation + await geoCatalog.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_GeoCatalogsUpdate() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Update.json + // this example is just showing the usage of "GeoCatalog_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this GeoCatalogResource created on azure + // for more information of creating GeoCatalogResource, please refer to the document of GeoCatalogResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + string catalogName = "MyCatalog"; + ResourceIdentifier geoCatalogResourceId = GeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); + GeoCatalogResource geoCatalog = client.GetGeoCatalogResource(geoCatalogResourceId); + + // invoke the operation + GeoCatalogPatch patch = new GeoCatalogPatch + { + Tags = +{ +["MyTag"] = "MyValue" +}, + Identity = new ManagedServiceIdentityUpdate + { + Type = Models.ManagedServiceIdentityType.UserAssigned, + UserAssignedIdentities = +{ +["/subscriptions/ac9a1867-7476-4346-bf8b-968370fe212c/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity"] = new UserAssignedIdentity() +}, + }, + }; + ArmOperation lro = await geoCatalog.UpdateAsync(WaitUntil.Completed, patch); + GeoCatalogResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..f60adfb6971d --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.PlanetaryComputer.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetGeoCatalogs_GeoCatalogsListBySubscription() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_ListBySubscription.json + // this example is just showing the usage of "GeoCatalog_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (GeoCatalogResource item in subscriptionResource.GetGeoCatalogsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Azure.ResourceManager.PlanetaryComputer.csproj b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Azure.ResourceManager.PlanetaryComputer.csproj new file mode 100644 index 000000000000..da5b0f0990ab --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Azure.ResourceManager.PlanetaryComputer.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider PlanetaryComputer. + 1.0.0-beta.1 + azure;management;arm;resource manager;PlanetaryComputer + Azure.ResourceManager.PlanetaryComputer + + diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ArmPlanetaryComputerModelFactory.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ArmPlanetaryComputerModelFactory.cs new file mode 100644 index 000000000000..c0cf1974e871 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ArmPlanetaryComputerModelFactory.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// Model factory for models. + public static partial class ArmPlanetaryComputerModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. + /// A new instance for mocking. + public static GeoCatalogData GeoCatalogData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GeoCatalogProperties properties = null, ManagedServiceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new GeoCatalogData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Tier of the catalog. This cannot be changed after the catalog is created. If not provided, defaults to Basic. + /// The URI of the catalog management UI. + /// The status of the last operation. + /// The scope of the auto-generated domain name label. If not provided, defaults to TenantReuse. + /// A new instance for mocking. + public static GeoCatalogProperties GeoCatalogProperties(CatalogTier? tier = null, string catalogUri = null, ProvisioningState? provisioningState = null, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = null) + { + return new GeoCatalogProperties(tier, catalogUri, provisioningState, autoGeneratedDomainNameLabelScope, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerArmClient.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerArmClient.cs new file mode 100644 index 000000000000..ac41b6df6e77 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerArmClient.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockablePlanetaryComputerArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockablePlanetaryComputerArmClient() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockablePlanetaryComputerArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockablePlanetaryComputerArmClient(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 GeoCatalogResource GetGeoCatalogResource(ResourceIdentifier id) + { + GeoCatalogResource.ValidateResourceId(id); + return new GeoCatalogResource(Client, id); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerResourceGroupResource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerResourceGroupResource.cs new file mode 100644 index 000000000000..88c144c45dce --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerResourceGroupResource.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockablePlanetaryComputerResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockablePlanetaryComputerResourceGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockablePlanetaryComputerResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of GeoCatalogResources in the ResourceGroupResource. + /// An object representing collection of GeoCatalogResources and their operations over a GeoCatalogResource. + public virtual GeoCatalogCollection GetGeoCatalogs() + { + return GetCachedClient(client => new GeoCatalogCollection(client, Id)); + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGeoCatalogAsync(string catalogName, CancellationToken cancellationToken = default) + { + return await GetGeoCatalogs().GetAsync(catalogName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGeoCatalog(string catalogName, CancellationToken cancellationToken = default) + { + return GetGeoCatalogs().Get(catalogName, cancellationToken); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerSubscriptionResource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerSubscriptionResource.cs new file mode 100644 index 000000000000..b657209ab2c4 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerSubscriptionResource.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.PlanetaryComputer.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockablePlanetaryComputerSubscriptionResource : ArmResource + { + private ClientDiagnostics _geoCatalogClientDiagnostics; + private GeoCatalogsRestOperations _geoCatalogRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockablePlanetaryComputerSubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockablePlanetaryComputerSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics GeoCatalogClientDiagnostics => _geoCatalogClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.PlanetaryComputer", GeoCatalogResource.ResourceType.Namespace, Diagnostics); + private GeoCatalogsRestOperations GeoCatalogRestClient => _geoCatalogRestClient ??= new GeoCatalogsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(GeoCatalogResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List GeoCatalog resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Orbital/geoCatalogs + /// + /// + /// Operation Id + /// GeoCatalog_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetGeoCatalogsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => GeoCatalogRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GeoCatalogRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GeoCatalogResource(Client, GeoCatalogData.DeserializeGeoCatalogData(e)), GeoCatalogClientDiagnostics, Pipeline, "MockablePlanetaryComputerSubscriptionResource.GetGeoCatalogs", "value", "nextLink", cancellationToken); + } + + /// + /// List GeoCatalog resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Orbital/geoCatalogs + /// + /// + /// Operation Id + /// GeoCatalog_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetGeoCatalogs(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => GeoCatalogRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GeoCatalogRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GeoCatalogResource(Client, GeoCatalogData.DeserializeGeoCatalogData(e)), GeoCatalogClientDiagnostics, Pipeline, "MockablePlanetaryComputerSubscriptionResource.GetGeoCatalogs", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs new file mode 100644 index 000000000000..c95ac251b794 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.PlanetaryComputer.Mocking; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + /// A class to add extension methods to Azure.ResourceManager.PlanetaryComputer. + public static partial class PlanetaryComputerExtensions + { + private static MockablePlanetaryComputerArmClient GetMockablePlanetaryComputerArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockablePlanetaryComputerArmClient(client0)); + } + + private static MockablePlanetaryComputerResourceGroupResource GetMockablePlanetaryComputerResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockablePlanetaryComputerResourceGroupResource(client, resource.Id)); + } + + private static MockablePlanetaryComputerSubscriptionResource GetMockablePlanetaryComputerSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockablePlanetaryComputerSubscriptionResource(client, resource.Id)); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static GeoCatalogResource GetGeoCatalogResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockablePlanetaryComputerArmClient(client).GetGeoCatalogResource(id); + } + + /// + /// Gets a collection of GeoCatalogResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of GeoCatalogResources and their operations over a GeoCatalogResource. + public static GeoCatalogCollection GetGeoCatalogs(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockablePlanetaryComputerResourceGroupResource(resourceGroupResource).GetGeoCatalogs(); + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the catalog. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetGeoCatalogAsync(this ResourceGroupResource resourceGroupResource, string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockablePlanetaryComputerResourceGroupResource(resourceGroupResource).GetGeoCatalogAsync(catalogName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the catalog. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetGeoCatalog(this ResourceGroupResource resourceGroupResource, string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockablePlanetaryComputerResourceGroupResource(resourceGroupResource).GetGeoCatalog(catalogName, cancellationToken); + } + + /// + /// List GeoCatalog resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Orbital/geoCatalogs + /// + /// + /// Operation Id + /// GeoCatalog_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetGeoCatalogsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockablePlanetaryComputerSubscriptionResource(subscriptionResource).GetGeoCatalogsAsync(cancellationToken); + } + + /// + /// List GeoCatalog resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Orbital/geoCatalogs + /// + /// + /// Operation Id + /// GeoCatalog_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetGeoCatalogs(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockablePlanetaryComputerSubscriptionResource(subscriptionResource).GetGeoCatalogs(cancellationToken); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogCollection.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogCollection.cs new file mode 100644 index 000000000000..e4e0c9b75739 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogCollection.cs @@ -0,0 +1,499 @@ + + + + + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetGeoCatalogs method from an instance of . + /// + public partial class GeoCatalogCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _geoCatalogClientDiagnostics; + private readonly GeoCatalogsRestOperations _geoCatalogRestClient; + + /// Initializes a new instance of the class for mocking. + protected GeoCatalogCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal GeoCatalogCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _geoCatalogClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PlanetaryComputer", GeoCatalogResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(GeoCatalogResource.ResourceType, out string geoCatalogApiVersion); + _geoCatalogRestClient = new GeoCatalogsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, geoCatalogApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Create + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the catalog. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string catalogName, GeoCatalogData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _geoCatalogRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data, cancellationToken).ConfigureAwait(false); + var operation = new PlanetaryComputerArmOperation(new GeoCatalogOperationSource(Client), _geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Create + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the catalog. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string catalogName, GeoCatalogData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _geoCatalogRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data, cancellationToken); + var operation = new PlanetaryComputerArmOperation(new GeoCatalogOperationSource(Client), _geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.Get"); + scope.Start(); + try + { + var response = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.Get"); + scope.Start(); + try + { + var response = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List GeoCatalog resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs + /// + /// + /// Operation Id + /// GeoCatalog_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _geoCatalogRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _geoCatalogRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GeoCatalogResource(Client, GeoCatalogData.DeserializeGeoCatalogData(e)), _geoCatalogClientDiagnostics, Pipeline, "GeoCatalogCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List GeoCatalog resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs + /// + /// + /// Operation Id + /// GeoCatalog_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _geoCatalogRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _geoCatalogRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GeoCatalogResource(Client, GeoCatalogData.DeserializeGeoCatalogData(e)), _geoCatalogClientDiagnostics, Pipeline, "GeoCatalogCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.Exists"); + scope.Start(); + try + { + var response = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.Exists"); + scope.Start(); + try + { + var response = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.GetIfExists"); + scope.Start(); + try + { + var response = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.Serialization.cs new file mode 100644 index 000000000000..d59e0a915a98 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PlanetaryComputer.Models; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + public partial class GeoCatalogData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + } + + GeoCatalogData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGeoCatalogData(document.RootElement, options); + } + + internal static GeoCatalogData DeserializeGeoCatalogData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + GeoCatalogProperties properties = default; + ManagedServiceIdentity identity = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = GeoCatalogProperties.DeserializeGeoCatalogProperties(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GeoCatalogData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + identity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GeoCatalogData)} does not support writing '{options.Format}' format."); + } + } + + GeoCatalogData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGeoCatalogData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GeoCatalogData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.cs new file mode 100644 index 000000000000..5360bb55ddd9 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PlanetaryComputer.Models; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + /// + /// A class representing the GeoCatalog data model. + /// A MPC Pro catalog resource + /// + public partial class GeoCatalogData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public GeoCatalogData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. + /// Keeps track of any properties unknown to the library. + internal GeoCatalogData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GeoCatalogProperties properties, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GeoCatalogData() + { + } + + /// The resource-specific properties for this resource. + public GeoCatalogProperties Properties { get; set; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs new file mode 100644 index 000000000000..9676d94f8089 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + public partial class GeoCatalogResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + GeoCatalogData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + GeoCatalogData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.cs new file mode 100644 index 000000000000..06508dcea103 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.cs @@ -0,0 +1,707 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.PlanetaryComputer.Models; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + /// + /// A Class representing a GeoCatalog along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetGeoCatalogResource method. + /// Otherwise you can get one from its parent resource using the GetGeoCatalog method. + /// + public partial class GeoCatalogResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The catalogName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string catalogName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _geoCatalogClientDiagnostics; + private readonly GeoCatalogsRestOperations _geoCatalogRestClient; + private readonly GeoCatalogData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Orbital/geoCatalogs"; + + /// Initializes a new instance of the class for mocking. + protected GeoCatalogResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal GeoCatalogResource(ArmClient client, GeoCatalogData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal GeoCatalogResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _geoCatalogClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PlanetaryComputer", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string geoCatalogApiVersion); + _geoCatalogRestClient = new GeoCatalogsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, geoCatalogApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual GeoCatalogData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Get"); + scope.Start(); + try + { + var response = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Get"); + scope.Start(); + try + { + var response = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Delete + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Delete"); + scope.Start(); + try + { + var response = await _geoCatalogRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new PlanetaryComputerArmOperation(_geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Delete + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Delete"); + scope.Start(); + try + { + var response = _geoCatalogRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new PlanetaryComputerArmOperation(_geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Update + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, GeoCatalogPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Update"); + scope.Start(); + try + { + var response = await _geoCatalogRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new PlanetaryComputerArmOperation(new GeoCatalogOperationSource(Client), _geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Update + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, GeoCatalogPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Update"); + scope.Start(); + try + { + var response = _geoCatalogRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new PlanetaryComputerArmOperation(new GeoCatalogOperationSource(Client), _geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new GeoCatalogPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new GeoCatalogPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new GeoCatalogPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new GeoCatalogPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new GeoCatalogPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new GeoCatalogPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Argument.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..6b7d943b8f10 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..6ecf5ab75a82 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingList.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..00588c1b682b --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..55cbebcc8aec --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal static class ModelSerializationExtensions + { + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Optional.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..8664b8d56939 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..b2caaa7f97ed --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs new file mode 100644 index 000000000000..71a167a6551d --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal class GeoCatalogOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal GeoCatalogOperationSource(ArmClient client) + { + _client = client; + } + + GeoCatalogResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new GeoCatalogResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new GeoCatalogResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperation.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperation.cs new file mode 100644 index 000000000000..24e38640c289 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperation.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.PlanetaryComputer +{ +#pragma warning disable SA1649 // File name should match first type name + internal class PlanetaryComputerArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of PlanetaryComputerArmOperation for mocking. + protected PlanetaryComputerArmOperation() + { + } + + internal PlanetaryComputerArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal PlanetaryComputerArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "PlanetaryComputerArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperationOfT.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperationOfT.cs new file mode 100644 index 000000000000..a01b9da93997 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperationOfT.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.PlanetaryComputer +{ +#pragma warning disable SA1649 // File name should match first type name + internal class PlanetaryComputerArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of PlanetaryComputerArmOperation for mocking. + protected PlanetaryComputerArmOperation() + { + } + + internal PlanetaryComputerArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal PlanetaryComputerArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "PlanetaryComputerArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs new file mode 100644 index 000000000000..0857b5b7a812 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// The scope at which the auto-generated domain name label is generated and at which the resource name can be reused. + public readonly partial struct AutoGeneratedDomainNameLabelScope : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutoGeneratedDomainNameLabelScope(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoReuseValue = "NoReuse"; + private const string TenantReuseValue = "TenantReuse"; + private const string SubscriptionReuseValue = "SubscriptionReuse"; + private const string ResourceGroupReuseValue = "ResourceGroupReuse"; + + /// The domain name label is randomly generated. The resource name cannot be reused within the same region. + public static AutoGeneratedDomainNameLabelScope NoReuse { get; } = new AutoGeneratedDomainNameLabelScope(NoReuseValue); + /// The domain name label is deterministically generated using the resource name and tenant id. The resource name cannot be reused within the same region and tenant. + public static AutoGeneratedDomainNameLabelScope TenantReuse { get; } = new AutoGeneratedDomainNameLabelScope(TenantReuseValue); + /// The domain name label is deterministically generated using the resource name, tenant id, and subscription id. The resource name cannot be reused within the same region and subscription. + public static AutoGeneratedDomainNameLabelScope SubscriptionReuse { get; } = new AutoGeneratedDomainNameLabelScope(SubscriptionReuseValue); + /// The domain name label is deterministically generated using the resource name, tenant id, subscription id, and resource group name. The resource name cannot be reused within the same resource group. + public static AutoGeneratedDomainNameLabelScope ResourceGroupReuse { get; } = new AutoGeneratedDomainNameLabelScope(ResourceGroupReuseValue); + /// Determines if two values are the same. + public static bool operator ==(AutoGeneratedDomainNameLabelScope left, AutoGeneratedDomainNameLabelScope right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutoGeneratedDomainNameLabelScope left, AutoGeneratedDomainNameLabelScope right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutoGeneratedDomainNameLabelScope(string value) => new AutoGeneratedDomainNameLabelScope(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutoGeneratedDomainNameLabelScope other && Equals(other); + /// + public bool Equals(AutoGeneratedDomainNameLabelScope other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/CatalogTier.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/CatalogTier.cs new file mode 100644 index 000000000000..24f63bb55fbd --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/CatalogTier.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// The Microsoft Planetary Computer Pro GeoCatalog tier. + public readonly partial struct CatalogTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CatalogTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BasicValue = "Basic"; + + /// The basic tier that utilizes shared resources across catalog instances. + public static CatalogTier Basic { get; } = new CatalogTier(BasicValue); + /// Determines if two values are the same. + public static bool operator ==(CatalogTier left, CatalogTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CatalogTier left, CatalogTier right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CatalogTier(string value) => new CatalogTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CatalogTier other && Equals(other); + /// + public bool Equals(CatalogTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs new file mode 100644 index 000000000000..5e6be2bcb7da --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + internal partial class GeoCatalogListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GeoCatalogListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGeoCatalogListResult(document.RootElement, options); + } + + internal static GeoCatalogListResult DeserializeGeoCatalogListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(GeoCatalogData.DeserializeGeoCatalogData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GeoCatalogListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GeoCatalogListResult)} does not support writing '{options.Format}' format."); + } + } + + GeoCatalogListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGeoCatalogListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GeoCatalogListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.cs new file mode 100644 index 000000000000..23354a592930 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// The response of a GeoCatalog list operation. + internal partial class GeoCatalogListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The GeoCatalog items on this page. + /// is null. + internal GeoCatalogListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The GeoCatalog items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal GeoCatalogListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GeoCatalogListResult() + { + } + + /// The GeoCatalog items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.Serialization.cs new file mode 100644 index 000000000000..d368659d1c95 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + public partial class GeoCatalogPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GeoCatalogPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGeoCatalogPatch(document.RootElement, options); + } + + internal static GeoCatalogPatch DeserializeGeoCatalogPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + ManagedServiceIdentityUpdate identity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = ManagedServiceIdentityUpdate.DeserializeManagedServiceIdentityUpdate(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GeoCatalogPatch(tags ?? new ChangeTrackingDictionary(), identity, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GeoCatalogPatch)} does not support writing '{options.Format}' format."); + } + } + + GeoCatalogPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGeoCatalogPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GeoCatalogPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.cs new file mode 100644 index 000000000000..789eb911cc8e --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// Patch request workaround for Swagger LintDiff. Typespec Bug: https://github.com/Azure/typespec-azure/issues/383. + public partial class GeoCatalogPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public GeoCatalogPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Updatable managed service identity. + /// Keeps track of any properties unknown to the library. + internal GeoCatalogPatch(IDictionary tags, ManagedServiceIdentityUpdate identity, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// Updatable managed service identity. + public ManagedServiceIdentityUpdate Identity { get; set; } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.Serialization.cs new file mode 100644 index 000000000000..ba5237f17430 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + public partial class GeoCatalogProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Tier)) + { + writer.WritePropertyName("tier"u8); + writer.WriteStringValue(Tier.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CatalogUri)) + { + writer.WritePropertyName("catalogUri"u8); + writer.WriteStringValue(CatalogUri); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(AutoGeneratedDomainNameLabelScope)) + { + writer.WritePropertyName("autoGeneratedDomainNameLabelScope"u8); + writer.WriteStringValue(AutoGeneratedDomainNameLabelScope.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GeoCatalogProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGeoCatalogProperties(document.RootElement, options); + } + + internal static GeoCatalogProperties DeserializeGeoCatalogProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CatalogTier? tier = default; + string catalogUri = default; + ProvisioningState? provisioningState = default; + AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tier = new CatalogTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("catalogUri"u8)) + { + catalogUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("autoGeneratedDomainNameLabelScope"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoGeneratedDomainNameLabelScope = new AutoGeneratedDomainNameLabelScope(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GeoCatalogProperties(tier, catalogUri, provisioningState, autoGeneratedDomainNameLabelScope, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GeoCatalogProperties)} does not support writing '{options.Format}' format."); + } + } + + GeoCatalogProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGeoCatalogProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GeoCatalogProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.cs new file mode 100644 index 000000000000..35bbc74e5624 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// Details of the MPC Pro GeoCatalog. + public partial class GeoCatalogProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public GeoCatalogProperties() + { + } + + /// Initializes a new instance of . + /// Tier of the catalog. This cannot be changed after the catalog is created. If not provided, defaults to Basic. + /// The URI of the catalog management UI. + /// The status of the last operation. + /// The scope of the auto-generated domain name label. If not provided, defaults to TenantReuse. + /// Keeps track of any properties unknown to the library. + internal GeoCatalogProperties(CatalogTier? tier, string catalogUri, ProvisioningState? provisioningState, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope, IDictionary serializedAdditionalRawData) + { + Tier = tier; + CatalogUri = catalogUri; + ProvisioningState = provisioningState; + AutoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Tier of the catalog. This cannot be changed after the catalog is created. If not provided, defaults to Basic. + public CatalogTier? Tier { get; set; } + /// The URI of the catalog management UI. + public string CatalogUri { get; } + /// The status of the last operation. + public ProvisioningState? ProvisioningState { get; } + /// The scope of the auto-generated domain name label. If not provided, defaults to TenantReuse. + public AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get; set; } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityType.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityType.cs new file mode 100644 index 000000000000..4faeefdaba2f --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + public readonly partial struct ManagedServiceIdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedServiceIdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string SystemAssignedValue = "SystemAssigned"; + private const string UserAssignedValue = "UserAssigned"; + private const string SystemAssignedUserAssignedValue = "SystemAssigned,UserAssigned"; + + /// No managed identity. + public static ManagedServiceIdentityType None { get; } = new ManagedServiceIdentityType(NoneValue); + /// System assigned managed identity. + public static ManagedServiceIdentityType SystemAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedValue); + /// User assigned managed identity. + public static ManagedServiceIdentityType UserAssigned { get; } = new ManagedServiceIdentityType(UserAssignedValue); + /// System and user assigned managed identity. + public static ManagedServiceIdentityType SystemAssignedUserAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedUserAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ManagedServiceIdentityType(string value) => new ManagedServiceIdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedServiceIdentityType other && Equals(other); + /// + public bool Equals(ManagedServiceIdentityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs new file mode 100644 index 000000000000..ef1cda0bb846 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + public partial class ManagedServiceIdentityUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedServiceIdentityUpdate)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } + if (Optional.IsCollectionDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"u8); + writer.WriteStartObject(); + foreach (var item in UserAssignedIdentities) + { + writer.WritePropertyName(item.Key); + JsonSerializer.Serialize(writer, item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedServiceIdentityUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedServiceIdentityUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedServiceIdentityUpdate(document.RootElement, options); + } + + internal static ManagedServiceIdentityUpdate DeserializeManagedServiceIdentityUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentityType? type = default; + IDictionary userAssignedIdentities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ManagedServiceIdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, JsonSerializer.Deserialize(property0.Value.GetRawText())); + } + userAssignedIdentities = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedServiceIdentityUpdate(type, userAssignedIdentities ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedServiceIdentityUpdate)} does not support writing '{options.Format}' format."); + } + } + + ManagedServiceIdentityUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedServiceIdentityUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedServiceIdentityUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.cs new file mode 100644 index 000000000000..cfdd66dcd7c1 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// The template for adding optional properties. + public partial class ManagedServiceIdentityUpdate + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ManagedServiceIdentityUpdate() + { + UserAssignedIdentities = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The type of managed identity assigned to this resource. + /// The identities assigned to this resource by the user. + /// Keeps track of any properties unknown to the library. + internal ManagedServiceIdentityUpdate(ManagedServiceIdentityType? type, IDictionary userAssignedIdentities, IDictionary serializedAdditionalRawData) + { + Type = type; + UserAssignedIdentities = userAssignedIdentities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of managed identity assigned to this resource. + public ManagedServiceIdentityType? Type { get; set; } + /// The identities assigned to this resource by the user. + public IDictionary UserAssignedIdentities { get; } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ProvisioningState.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..3082d5771f8c --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// The status of the current operation. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + + /// Resource has been created. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Resource creation failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// The catalog is being provisioned. + public static ProvisioningState Provisioning { get; } = new ProvisioningState(ProvisioningValue); + /// The catalog is being updated. + public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); + /// The catalog is being deleted. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// The catalog request has been accepted. + public static ProvisioningState Accepted { get; } = new ProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); + /// + public bool Equals(ProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ProviderConstants.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..5056bd5a11f7 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/RestOperations/GeoCatalogsRestOperations.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/RestOperations/GeoCatalogsRestOperations.cs new file mode 100644 index 000000000000..9f515e77664d --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/RestOperations/GeoCatalogsRestOperations.cs @@ -0,0 +1,723 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.PlanetaryComputer.Models; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal partial class GeoCatalogsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of GeoCatalogsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public GeoCatalogsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-11-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string catalogName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string catalogName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, catalogName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GeoCatalogData.DeserializeGeoCatalogData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GeoCatalogData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, catalogName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GeoCatalogData.DeserializeGeoCatalogData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GeoCatalogData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, catalogName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, catalogName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string catalogName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string catalogName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List GeoCatalog resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List GeoCatalog resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List GeoCatalog resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List GeoCatalog resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List GeoCatalog resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List GeoCatalog resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List GeoCatalog resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List GeoCatalog resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..924e36b542b1 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.PlanetaryComputer.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("PlanetaryComputer")] diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Azure.ResourceManager.PlanetaryComputer.Tests.csproj b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Azure.ResourceManager.PlanetaryComputer.Tests.csproj new file mode 100644 index 000000000000..15a4d54cdc27 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Azure.ResourceManager.PlanetaryComputer.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestBase.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestBase.cs new file mode 100644 index 000000000000..cc704476bfd9 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.PlanetaryComputer.Tests +{ + public class PlanetaryComputerManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected PlanetaryComputerManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected PlanetaryComputerManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestEnvironment.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestEnvironment.cs new file mode 100644 index 000000000000..36816598185e --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.PlanetaryComputer.Tests +{ + public class PlanetaryComputerManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs new file mode 100644 index 000000000000..b7e797fdb2d4 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.PlanetaryComputer; +using Azure.ResourceManager.PlanetaryComputer.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.PlanetaryComputer.Tests +{ + [TestFixture(true)] + public class GeoCatalogCollectionTests : PlanetaryComputerManagementTestBase + { + // Add an exsiting geocatalo + private const string ExistingGeoCatalogName = ""; + private const string ResourceGroupName = "shakrao-test"; + private const string Region = "uksouth"; + + public GeoCatalogCollectionTests(bool isAsync) + : base(isAsync) // <-- Forces Record mode explicitly + { + } + + [Test] + [RecordedTest] + public async Task ListGeoCatalogsInResourceGroup() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + ResourceGroupResource rg = await subscription.GetResourceGroups().GetAsync(ResourceGroupName); + GeoCatalogCollection collection = rg.GetGeoCatalogs(); + + int count = 0; + await foreach (GeoCatalogResource item in collection.GetAllAsync()) + { + TestContext.WriteLine($"GeoCatalog: {item.Data.Name}"); + count++; + } + + Assert.GreaterOrEqual(count, 0); + } + + [Test] + [RecordedTest] + public async Task GetGeoCatalog() + { + if (string.IsNullOrEmpty(ExistingGeoCatalogName)) + { + Assert.Inconclusive("No existing GeoCatalog name provided."); + return; + } + + GeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); + GeoCatalogResource catalog = await collection.GetAsync(ExistingGeoCatalogName); + + Assert.AreEqual(ExistingGeoCatalogName, catalog.Data.Name); + Assert.AreEqual(Region.ToLowerInvariant(), catalog.Data.Location.ToString().ToLowerInvariant()); + TestContext.WriteLine($"Catalog URI: {catalog.Data.Properties.CatalogUri}"); + } + + [Test] + [RecordedTest] + public async Task CreateGeoCatalog() + { + string catalogName = Recording.GenerateAssetName("testcatalog-"); + GeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); + GeoCatalogData data = new GeoCatalogData(new AzureLocation(Region)) + { + Identity = new ManagedServiceIdentity(Azure.ResourceManager.Models.ManagedServiceIdentityType.UserAssigned) + { + UserAssignedIdentities = + { + [new ResourceIdentifier($"/subscriptions/{Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID")}/resourceGroups/{Environment.GetEnvironmentVariable("AZURE_RESOURCE_GROUP")}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{Environment.GetEnvironmentVariable("AZURE_IDENTITY_NAME")}")] = new UserAssignedIdentity() + } + }, + Properties = new GeoCatalogProperties + { + Tier = CatalogTier.Basic, + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.TenantReuse + }, + Tags = { ["env"] = "test" } + }; + + ArmOperation operation = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + GeoCatalogResource result = operation.Value; + + Assert.AreEqual(catalogName, result.Data.Name); + Assert.AreEqual(CatalogTier.Basic, result.Data.Properties.Tier); + TestContext.WriteLine($"Created GeoCatalog: {result.Id}"); + } + + [Test] + [RecordedTest] + public async Task UpdateGeoCatalog() + { + string catalogName = Recording.GenerateAssetName("testcatalog-"); + GeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); + + GeoCatalogData data = new GeoCatalogData(new AzureLocation(Region)) + { + Properties = new GeoCatalogProperties + { + Tier = CatalogTier.Basic, + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.TenantReuse + }, + Tags = { ["env"] = "initial" } + }; + + ArmOperation createOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + GeoCatalogResource resource = createOp.Value; + + resource.Data.Tags["env"] = "updated"; + ArmOperation updateOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, resource.Data); + GeoCatalogResource updated = updateOp.Value; + + Assert.AreEqual("updated", updated.Data.Tags["env"]); + TestContext.WriteLine($"Updated GeoCatalog: {updated.Id}"); + } + + [Test] + [RecordedTest] + public async Task DeleteGeoCatalog() + { + string catalogName = Recording.GenerateAssetName("testcatalog-"); + GeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); + + GeoCatalogData data = new GeoCatalogData(new AzureLocation(Region)) + { + Properties = new GeoCatalogProperties + { + Tier = CatalogTier.Basic, + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.TenantReuse + }, + Tags = { ["env"] = "delete" } + }; + + ArmOperation createOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + GeoCatalogResource resource = createOp.Value; + + ArmOperation deleteOp = await resource.DeleteAsync(WaitUntil.Completed); + Assert.IsTrue(deleteOp.HasCompleted); + + bool exists = await collection.ExistsAsync(catalogName); + Assert.IsFalse(exists); + TestContext.WriteLine($"Deleted GeoCatalog: {catalogName}"); + } + + [Test] + [RecordedTest] + public async Task ListGeoCatalogsBySubscription() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + AsyncPageable catalogs = subscription.GetGeoCatalogsAsync(); + + int count = 0; + await foreach (GeoCatalogResource item in catalogs) + { + TestContext.WriteLine($"[Subscription List] GeoCatalog: {item.Data.Name}"); + count++; + } + Assert.GreaterOrEqual(count, 0); + } + [Test] + [RecordedTest] + public async Task CreateUpdateDeleteGeoCatalog() + { + Console.WriteLine($"[MODE] Test is running in: {TestEnvironment.Mode}"); + + string catalogName = Recording.GenerateAssetName("testcatalog-"); + GeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); + + // Step 1: Create + GeoCatalogData data = new GeoCatalogData(new AzureLocation(Region)) + { + Properties = new GeoCatalogProperties + { + Tier = CatalogTier.Basic, + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.TenantReuse + }, + Tags = { ["env"] = "initial" } + }; + + ArmOperation createOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + GeoCatalogResource resource = createOp.Value; + + Assert.AreEqual("initial", resource.Data.Tags["env"]); + TestContext.WriteLine($"โœ… Created GeoCatalog: {resource.Id}"); + + // Step 2: Update + resource.Data.Tags["env"] = "updated"; + ArmOperation updateOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, resource.Data); + GeoCatalogResource updated = updateOp.Value; + + Assert.AreEqual("updated", updated.Data.Tags["env"]); + TestContext.WriteLine($"๐Ÿ”„ Updated GeoCatalog: {updated.Id}"); + + // Step 3: Delete + ArmOperation deleteOp = await updated.DeleteAsync(WaitUntil.Completed); + Assert.IsTrue(deleteOp.HasCompleted); + + bool exists = await collection.ExistsAsync(catalogName); + Assert.IsFalse(exists); + TestContext.WriteLine($"โŒ Deleted GeoCatalog: {catalogName}"); + } + + private async Task GetGeoCatalogCollectionAsync() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + ResourceGroupResource rg = await subscription.GetResourceGroups().GetAsync(ResourceGroupName); + return rg.GetGeoCatalogs(); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test-resources.json b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test-resources.json new file mode 100644 index 000000000000..ede357a93212 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test-resources.json @@ -0,0 +1,7 @@ +{ + "record": true, + "variables": { + "AZURE_SUBSCRIPTION_ID": "00000000-0000-0000-0000-000000000000", + "AZURE_RESOURCE_GROUP": "test" + } + } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test.runsettings b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test.runsettings new file mode 100644 index 000000000000..4874433e61e2 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test.runsettings @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml new file mode 100644 index 000000000000..b16d32804f4d --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/spatio/PlanetaryComputerPro +commit: 0d7256e6981a80f797551fd87944458686e447fa +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/planetarycomputer/ci.mgmt.yml b/sdk/planetarycomputer/ci.mgmt.yml new file mode 100644 index 000000000000..93b8b6149a83 --- /dev/null +++ b/sdk/planetarycomputer/ci.mgmt.yml @@ -0,0 +1,30 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/PlanetaryComputer/ci.mgmt.yml + - sdk/PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer/ + +/ci.mgmt.yml + - sdk/PlanetaryComputer +/Azure.ResourceManager.PlanetaryComputer +/ + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: PlanetaryComputer + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.PlanetaryComputer + safeName: AzureResourceManagerPlanetaryComputer diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 023f426435be..75de9d9e649f 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -159,6 +159,7 @@ trigger: - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw - sdk/peering/Azure.ResourceManager.Peering - sdk/pineconevectordb/Azure.ResourceManager.PineconeVectorDB + - sdk/PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting - sdk/policyinsights/Azure.ResourceManager.PolicyInsights - sdk/portalservices/Azure.ResourceManager.PortalServicesCopilot @@ -383,6 +384,7 @@ pr: - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw - sdk/peering/Azure.ResourceManager.Peering - sdk/pineconevectordb/Azure.ResourceManager.PineconeVectorDB + - sdk/PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting - sdk/policyinsights/Azure.ResourceManager.PolicyInsights - sdk/portalservices/Azure.ResourceManager.PortalServicesCopilot From 7052dfa42592501004b23d678a23b51494a23866 Mon Sep 17 00:00:00 2001 From: Shakti Chetan Rao <55005052+shaktichetan23@users.noreply.github.com> Date: Tue, 24 Jun 2025 12:38:51 -0700 Subject: [PATCH 02/43] Update sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../src/Properties/AssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs index 924e36b542b1..2b70fe3e4880 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ [assembly: InternalsVisibleTo("Azure.ResourceManager.PlanetaryComputer.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] -// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// Replace Microsoft.Test with the correct resource provider namespace for your service and uncomment. // See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers // for the list of possible values. [assembly: Azure.Core.AzureResourceProviderNamespace("PlanetaryComputer")] From 4e370cc1cfc382af650cf73621ff418629134008 Mon Sep 17 00:00:00 2001 From: Shakti Chetan Rao <55005052+shaktichetan23@users.noreply.github.com> Date: Tue, 24 Jun 2025 12:38:58 -0700 Subject: [PATCH 03/43] Update sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../tests/Scenario/GeoCatalogCollectionTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs index b7e797fdb2d4..57cf9daa6c4e 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs @@ -18,7 +18,7 @@ namespace Azure.ResourceManager.PlanetaryComputer.Tests [TestFixture(true)] public class GeoCatalogCollectionTests : PlanetaryComputerManagementTestBase { - // Add an exsiting geocatalo + // Add an existing GeoCatalog private const string ExistingGeoCatalogName = ""; private const string ResourceGroupName = "shakrao-test"; private const string Region = "uksouth"; From 924bd2c4c9ca9064e83de07c20fa7fd699674f41 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Tue, 24 Jun 2025 15:00:33 -0700 Subject: [PATCH 04/43] readme update --- .../Azure.ResourceManager.PlanetaryComputer/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index a99b562d5edd..833349748b05 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -54,6 +54,7 @@ dotnet add package Azure.ResourceManager.PlanetaryComputer --prerelease $env:AZURE_SUBSCRIPTION_ID = "" $env:AZURE_TEST_MODE = "Record" # or "Playback" $env:AZURE_AUTHORITY_HOST = "https://login.microsoftonline.com" +$env:AZURE_IDENTITY_NAME = "" ``` --- From e87c14aba1bd49fc0aaf9ed903921226624f2993 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Tue, 24 Jun 2025 15:39:27 -0700 Subject: [PATCH 05/43] fix checks --- .../Azure.ResourceManager.PlanetaryComputer/README.md | 2 +- .../Azure.ResourceManager.PlanetaryComputer/assets.json | 2 +- .../tests/Scenario/GeoCatalogCollectionTests.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 833349748b05..2799c5311589 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -37,7 +37,7 @@ dotnet add package Azure.ResourceManager.PlanetaryComputer --prerelease --- -## ๐Ÿ› ๏ธ Prerequisites +### ๐Ÿ› ๏ธ Prerequisites - [.NET SDK 8.0+](https://dotnet.microsoft.com/download) - [Azure SDK Test Proxy](https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json index 32f3501ad879..ef91b34e7abd 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json @@ -2,7 +2,7 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer", - "Tag": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer_0827ee99b3", + "Tag": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer_04278b495e", "ServiceDirectory": "planetarycomputer", "SessionRecordsDirectory": "SessionRecords" } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs index 57cf9daa6c4e..90251d77fd4b 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs @@ -76,7 +76,7 @@ public async Task CreateGeoCatalog() { UserAssignedIdentities = { - [new ResourceIdentifier($"/subscriptions/{Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID")}/resourceGroups/{Environment.GetEnvironmentVariable("AZURE_RESOURCE_GROUP")}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{Environment.GetEnvironmentVariable("AZURE_IDENTITY_NAME")}")] = new UserAssignedIdentity() + [new ResourceIdentifier($"/subscriptions/ac9a1867-7476-4346-bf8b-968370fe212c/resourceGroups/msi-test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-uk-1")] = new UserAssignedIdentity() } }, Properties = new GeoCatalogProperties From b291f5866753831cb93c8e944637b5b8665dac18 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Tue, 24 Jun 2025 16:35:17 -0700 Subject: [PATCH 06/43] fix checks --- .../README.md | 20 +++++++++++-------- .../assets.json | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 2799c5311589..857cda376da9 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -6,7 +6,7 @@ It supports full **CRUD operations**, as well as **recorded** and **playback tes --- -## ๐Ÿ“ Project Structure +## Project Structure ``` sdk/ @@ -25,9 +25,9 @@ sdk/ --- -## ๐Ÿš€ Getting Started +## Getting Started -### ๐Ÿ“ฆ Install the Package +### Install the Package Install the package via [NuGet](https://www.nuget.org/): @@ -37,7 +37,7 @@ dotnet add package Azure.ResourceManager.PlanetaryComputer --prerelease --- -### ๐Ÿ› ๏ธ Prerequisites +### Prerequisites - [.NET SDK 8.0+](https://dotnet.microsoft.com/download) - [Azure SDK Test Proxy](https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md) @@ -57,9 +57,13 @@ $env:AZURE_AUTHORITY_HOST = "https://login.microsoftonline.com" $env:AZURE_IDENTITY_NAME = "" ``` +### Authenticate the Client +Not required + + --- -## โœ… Supported Tests +## Supported Tests | Test Name | Description | |----------------------------------|---------------------------------------------| @@ -73,9 +77,9 @@ $env:AZURE_IDENTITY_NAME = "" --- -## ๐Ÿงช Running Tests +## Running Tests -### โ–ถ๏ธ Record Mode (Live with Azure) +### Record Mode (Live with Azure) 1. Start the test proxy: ```bash @@ -96,7 +100,7 @@ $env:AZURE_IDENTITY_NAME = "" --- -### โฏ๏ธ Playback Mode (Offline Testing) +### Playback Mode (Offline Testing) 1. Set mode: ```bash diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json index ef91b34e7abd..7dd2ebe09b97 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json @@ -2,7 +2,7 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer", - "Tag": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer_04278b495e", + "Tag": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer_c9092f326f", "ServiceDirectory": "planetarycomputer", "SessionRecordsDirectory": "SessionRecords" } From 9bb6c0ab3c5fd296017a163945c6465f2aa41eb0 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 08:54:11 -0700 Subject: [PATCH 07/43] fix recorded tests --- .../Azure.ResourceManager.PlanetaryComputer/README.md | 10 +++++----- .../assets.json | 2 +- .../tests/Scenario/GeoCatalogCollectionTests.cs | 8 +++++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 857cda376da9..63205cb6c79a 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -25,9 +25,9 @@ sdk/ --- -## Getting Started +## Getting Started -### Install the Package +### Install the Package Install the package via [NuGet](https://www.nuget.org/): @@ -37,7 +37,7 @@ dotnet add package Azure.ResourceManager.PlanetaryComputer --prerelease --- -### Prerequisites +### Prerequisites - [.NET SDK 8.0+](https://dotnet.microsoft.com/download) - [Azure SDK Test Proxy](https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md) @@ -63,7 +63,7 @@ Not required --- -## Supported Tests +## Supported Tests | Test Name | Description | |----------------------------------|---------------------------------------------| @@ -77,7 +77,7 @@ Not required --- -## Running Tests +## Running Tests ### Record Mode (Live with Azure) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json index 7dd2ebe09b97..db5f881ed922 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json @@ -2,7 +2,7 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer", - "Tag": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer_c9092f326f", + "Tag": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer_d1a808570c", "ServiceDirectory": "planetarycomputer", "SessionRecordsDirectory": "SessionRecords" } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs index 90251d77fd4b..caf83929f7d8 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs @@ -18,9 +18,11 @@ namespace Azure.ResourceManager.PlanetaryComputer.Tests [TestFixture(true)] public class GeoCatalogCollectionTests : PlanetaryComputerManagementTestBase { - // Add an existing GeoCatalog + // Add ExistingGeoCatalogName if you have a catalog to test against. This is for testing the GetGeoCatalog method. private const string ExistingGeoCatalogName = ""; - private const string ResourceGroupName = "shakrao-test"; + // Set the ResourceGroupName and Region to match your Azure environment. + // Ensure the resource group exists in your subscription. + private const string ResourceGroupName = "test"; private const string Region = "uksouth"; public GeoCatalogCollectionTests(bool isAsync) @@ -76,7 +78,7 @@ public async Task CreateGeoCatalog() { UserAssignedIdentities = { - [new ResourceIdentifier($"/subscriptions/ac9a1867-7476-4346-bf8b-968370fe212c/resourceGroups/msi-test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-uk-1")] = new UserAssignedIdentity() + [new ResourceIdentifier($"/subscriptions/{Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID")}/resourceGroups/shakrao-test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{Environment.GetEnvironmentVariable("AZURE_IDENTITY_NAME")}")] = new UserAssignedIdentity() } }, Properties = new GeoCatalogProperties From 0dd75c2cc5299a375bf386092073edbde4723d93 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 09:22:15 -0700 Subject: [PATCH 08/43] fix readme --- .../README.md | 71 +++++++++++++++++-- 1 file changed, 65 insertions(+), 6 deletions(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 63205cb6c79a..4e4e1263ccc7 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -6,7 +6,7 @@ It supports full **CRUD operations**, as well as **recorded** and **playback tes --- -## Project Structure +## Project Structure ``` sdk/ @@ -54,13 +54,8 @@ dotnet add package Azure.ResourceManager.PlanetaryComputer --prerelease $env:AZURE_SUBSCRIPTION_ID = "" $env:AZURE_TEST_MODE = "Record" # or "Playback" $env:AZURE_AUTHORITY_HOST = "https://login.microsoftonline.com" -$env:AZURE_IDENTITY_NAME = "" ``` -### Authenticate the Client -Not required - - --- ## Supported Tests @@ -114,3 +109,67 @@ Not required ```bash dotnet test -f net8.0 --filter "Name=CreateUpdateDeleteGeoCatalog" ``` + +--- + +## Authenticate the Client + +To authenticate the client, use the `DefaultAzureCredential` from the Azure.Identity library. Ensure your environment is set up with the necessary Azure credentials. + +```csharp +using Azure.Identity; +using Azure.ResourceManager.PlanetaryComputer; + +var credential = new DefaultAzureCredential(); +var client = new PlanetaryComputerManagementClient(credential); +``` + +## Key Concepts + +The PlanetaryComputer SDK provides management capabilities for GeoCatalog resources. Key concepts include: +- **GeoCatalog**: Represents a catalog of geospatial data. +- **CRUD Operations**: Create, Read, Update, and Delete operations for GeoCatalog resources. +- **Authentication**: Uses Azure Active Directory for secure access. + +## Examples + +### Create a GeoCatalog + +```csharp +var geoCatalogData = new GeoCatalogData(new AzureLocation("uksouth")) +{ + Properties = new GeoCatalogProperties + { + Tier = CatalogTier.Basic + } +}; + +var geoCatalog = await client.GeoCatalogs.CreateOrUpdateAsync("resourceGroupName", "geoCatalogName", geoCatalogData); +``` + +### List GeoCatalogs + +```csharp +var geoCatalogs = await client.GeoCatalogs.ListAsync("resourceGroupName"); +foreach (var catalog in geoCatalogs) +{ + Console.WriteLine(catalog.Name); +} +``` + +## Troubleshooting + +If you encounter issues, check the following: +- Ensure Azure CLI is logged in (`az login`). +- Verify the subscription and resource group names. +- Check for network connectivity issues. + +## Next Steps + +Explore additional features of the PlanetaryComputer SDK: +- [Azure SDK Documentation](https://learn.microsoft.com/en-us/azure/) +- [Samples Repository](https://github.com/Azure/azure-sdk-for-net) + +## Contributing + +We welcome contributions! Please see our [Contributing Guide](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for details on how to get started. From 18f94a0948d8c8cd7292c345ab135fa1220dc1d9 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 09:43:41 -0700 Subject: [PATCH 09/43] fix readme 2 --- .../Azure.ResourceManager.PlanetaryComputer/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 4e4e1263ccc7..4cae0986a648 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -167,7 +167,6 @@ If you encounter issues, check the following: ## Next Steps Explore additional features of the PlanetaryComputer SDK: -- [Azure SDK Documentation](https://learn.microsoft.com/en-us/azure/) - [Samples Repository](https://github.com/Azure/azure-sdk-for-net) ## Contributing From 3f3f78bafd2397a9f51da96638bb3165a511e1f9 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 16:55:21 -0700 Subject: [PATCH 10/43] fix readme 3 --- .../Azure.ResourceManager.PlanetaryComputer/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 4cae0986a648..28f0fd63d008 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -1,4 +1,4 @@ -# Microsoft Azure PlanetaryComputer Management Client Library for .NET +## Azure PlanetaryComputer Management Client Library for .NET The `Azure.ResourceManager.PlanetaryComputer` SDK is the **.NET Management Plane SDK** for working with `GeoCatalog` resources under the **PlanetaryComputer** service. @@ -25,7 +25,7 @@ sdk/ --- -## Getting Started +## Getting started ### Install the Package @@ -124,7 +124,7 @@ var credential = new DefaultAzureCredential(); var client = new PlanetaryComputerManagementClient(credential); ``` -## Key Concepts +## Key concepts The PlanetaryComputer SDK provides management capabilities for GeoCatalog resources. Key concepts include: - **GeoCatalog**: Represents a catalog of geospatial data. @@ -164,9 +164,10 @@ If you encounter issues, check the following: - Verify the subscription and resource group names. - Check for network connectivity issues. -## Next Steps +## Next steps Explore additional features of the PlanetaryComputer SDK: +- [Azure SDK Documentation](https://learn.microsoft.com/en-us/azure/) - [Samples Repository](https://github.com/Azure/azure-sdk-for-net) ## Contributing From c44f01e9509923aa9a5350f3343ba6787a32ed63 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 16:55:40 -0700 Subject: [PATCH 11/43] fix readme 4 --- .../tests/Scenario/GeoCatalogCollectionTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs index caf83929f7d8..f3695af637d6 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs @@ -22,7 +22,7 @@ public class GeoCatalogCollectionTests : PlanetaryComputerManagementTestBase private const string ExistingGeoCatalogName = ""; // Set the ResourceGroupName and Region to match your Azure environment. // Ensure the resource group exists in your subscription. - private const string ResourceGroupName = "test"; + private const string ResourceGroupName = "shakrao-test"; private const string Region = "uksouth"; public GeoCatalogCollectionTests(bool isAsync) From 540cc34040ae80f0962d68ae5fbc52e937bf5c35 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 17:08:11 -0700 Subject: [PATCH 12/43] fix readme 5 --- .../Azure.ResourceManager.PlanetaryComputer/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 28f0fd63d008..7195682379d2 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -167,7 +167,6 @@ If you encounter issues, check the following: ## Next steps Explore additional features of the PlanetaryComputer SDK: -- [Azure SDK Documentation](https://learn.microsoft.com/en-us/azure/) - [Samples Repository](https://github.com/Azure/azure-sdk-for-net) ## Contributing From 63bd0a4a4df3eead1f728d2bb98d8e44d7b0f3dc Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 18:08:43 -0700 Subject: [PATCH 13/43] fix readme 6 --- .../README.md | 24 +++++++++---------- .../Scenario/GeoCatalogCollectionTests.cs | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 7195682379d2..d31653a6fc65 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -55,9 +55,20 @@ $env:AZURE_SUBSCRIPTION_ID = "" $env:AZURE_TEST_MODE = "Record" # or "Playback" $env:AZURE_AUTHORITY_HOST = "https://login.microsoftonline.com" ``` - --- +### Authenticate the Client + +To authenticate the client, use the `DefaultAzureCredential` from the Azure.Identity library. Ensure your environment is set up with the necessary Azure credentials. + +```csharp +using Azure.Identity; +using Azure.ResourceManager.PlanetaryComputer; + +var credential = new DefaultAzureCredential(); +var client = new PlanetaryComputerManagementClient(credential); +``` + ## Supported Tests | Test Name | Description | @@ -112,17 +123,6 @@ $env:AZURE_AUTHORITY_HOST = "https://login.microsoftonline.com" --- -## Authenticate the Client - -To authenticate the client, use the `DefaultAzureCredential` from the Azure.Identity library. Ensure your environment is set up with the necessary Azure credentials. - -```csharp -using Azure.Identity; -using Azure.ResourceManager.PlanetaryComputer; - -var credential = new DefaultAzureCredential(); -var client = new PlanetaryComputerManagementClient(credential); -``` ## Key concepts diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs index f3695af637d6..fb6616c5158f 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs @@ -78,7 +78,7 @@ public async Task CreateGeoCatalog() { UserAssignedIdentities = { - [new ResourceIdentifier($"/subscriptions/{Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID")}/resourceGroups/shakrao-test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{Environment.GetEnvironmentVariable("AZURE_IDENTITY_NAME")}")] = new UserAssignedIdentity() + [new ResourceIdentifier($"/subscriptions/ac9a1867-7476-4346-bf8b-968370fe212c/resourceGroups/msi-test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-uk-1")] = new UserAssignedIdentity() } }, Properties = new GeoCatalogProperties From 8607be20441c57ff190b56261a305092e8165b18 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 18:29:49 -0700 Subject: [PATCH 14/43] fix readme 7 --- .../Azure.ResourceManager.PlanetaryComputer/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index d31653a6fc65..e49b2b9c4c0f 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -1,4 +1,4 @@ -## Azure PlanetaryComputer Management Client Library for .NET +## Microsft Azure PlanetaryComputer client library for .NET The `Azure.ResourceManager.PlanetaryComputer` SDK is the **.NET Management Plane SDK** for working with `GeoCatalog` resources under the **PlanetaryComputer** service. From 4cc33540e00b08e973234475a2751203d160f7c2 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 22:12:47 -0700 Subject: [PATCH 15/43] ignore spell check for the word spatio --- .vscode/cspell.json | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 470cebeef2cf..62370495fb4a 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -48,6 +48,7 @@ "sdk/machinelearningservices/*/api/*.cs", "sdk/modelsrepository/*/api/*.cs", "sdk/monitor/Azure.ResourceManager.Monitor/api/*.cs", + "sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/*.cs", "sdk/objectanchors/*/api/*.cs", "sdk/openai/Azure.AI.OpenAI/tests/Assets/playback_test_config.json", "sdk/purview/*/api/*.cs", @@ -159,6 +160,7 @@ "skus", "Somaxconn", "southcentralus", + "spatio", "structs", "Sybase", "Sysctls", @@ -428,14 +430,6 @@ "tibt" ] }, - { - "filename": "**/sdk/connectedcache/**/*", - "words": [ - "Gbps", - "Mbps", - "Eflow" - ] - }, { "filename": "**/sdk/connectedvmwarevsphere/**/*", "words": [ @@ -1133,7 +1127,6 @@ "dnsprivateviewocid", "Ords", "Ocid", - "Ocids", "ncharacter", "ocpu", "Iorm", @@ -1144,11 +1137,7 @@ "Tcps", "Ezconnect", "Ezconnectplus", - "Oltp", - "exadb", - "Exadb", - "Exascale", - "exascale" + "Oltp" ] }, { From 2d3ffa41815478779d344c8fc31f50d00a91daa5 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Tue, 24 Jun 2025 12:35:40 -0700 Subject: [PATCH 16/43] add planetary computer sdk for dotnet --- ...zure.ResourceManager.PlanetaryComputer.sln | 56 ++ .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 111 +++ ...esourceManager.PlanetaryComputer.net8.0.cs | 213 ++++++ ...anager.PlanetaryComputer.netstandard2.0.cs | 213 ++++++ .../assets.json | 8 + ...ceManager.PlanetaryComputer.Samples.csproj | 13 + .../Generated/Samples/GeneratedSamples.csproj | 21 + .../Samples/Sample_GeoCatalogCollection.cs | 212 +++++ .../Samples/Sample_GeoCatalogResource.cs | 122 +++ .../Sample_SubscriptionResourceExtensions.cs | 50 ++ ...e.ResourceManager.PlanetaryComputer.csproj | 8 + .../ArmPlanetaryComputerModelFactory.cs | 56 ++ .../MockablePlanetaryComputerArmClient.cs | 49 ++ ...ePlanetaryComputerResourceGroupResource.cs | 105 +++ ...lePlanetaryComputerSubscriptionResource.cs | 102 +++ .../Extensions/PlanetaryComputerExtensions.cs | 219 ++++++ .../src/Generated/GeoCatalogCollection.cs | 499 ++++++++++++ .../Generated/GeoCatalogData.Serialization.cs | 196 +++++ .../src/Generated/GeoCatalogData.cs | 87 +++ .../GeoCatalogResource.Serialization.cs | 26 + .../src/Generated/GeoCatalogResource.cs | 707 +++++++++++++++++ .../src/Generated/Internal/Argument.cs | 129 ++++ .../Internal/ChangeTrackingDictionary.cs | 167 ++++ .../Generated/Internal/ChangeTrackingList.cs | 153 ++++ .../Internal/ModelSerializationExtensions.cs | 399 ++++++++++ .../src/Generated/Internal/Optional.cs | 51 ++ .../Internal/Utf8JsonRequestContent.cs | 55 ++ .../GeoCatalogOperationSource.cs | 36 + .../PlanetaryComputerArmOperation.cs | 94 +++ .../PlanetaryComputerArmOperationOfT.cs | 100 +++ .../AutoGeneratedDomainNameLabelScope.cs | 57 ++ .../src/Generated/Models/CatalogTier.cs | 48 ++ .../GeoCatalogListResult.Serialization.cs | 151 ++++ .../Generated/Models/GeoCatalogListResult.cs | 80 ++ .../Models/GeoCatalogPatch.Serialization.cs | 159 ++++ .../src/Generated/Models/GeoCatalogPatch.cs | 70 ++ .../GeoCatalogProperties.Serialization.cs | 174 +++++ .../Generated/Models/GeoCatalogProperties.cs | 77 ++ .../Models/ManagedServiceIdentityType.cs | 57 ++ ...agedServiceIdentityUpdate.Serialization.cs | 160 ++++ .../Models/ManagedServiceIdentityUpdate.cs | 71 ++ .../src/Generated/Models/ProvisioningState.cs | 66 ++ .../src/Generated/ProviderConstants.cs | 16 + .../GeoCatalogsRestOperations.cs | 723 ++++++++++++++++++ .../src/Properties/AssemblyInfo.cs | 11 + ...urceManager.PlanetaryComputer.Tests.csproj | 8 + .../PlanetaryComputerManagementTestBase.cs | 45 ++ ...netaryComputerManagementTestEnvironment.cs | 11 + .../Scenario/GeoCatalogCollectionTests.cs | 219 ++++++ .../tests/test-resources.json | 7 + .../tests/test.runsettings | 8 + .../tsp-location.yaml | 4 + sdk/planetarycomputer/ci.mgmt.yml | 30 + sdk/resourcemanager/ci.mgmt.yml | 2 + 56 files changed, 6528 insertions(+) create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer.sln create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Directory.Build.props create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Azure.ResourceManager.PlanetaryComputer.Samples.csproj create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/GeneratedSamples.csproj create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogCollection.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogResource.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Azure.ResourceManager.PlanetaryComputer.csproj create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ArmPlanetaryComputerModelFactory.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerArmClient.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerResourceGroupResource.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerSubscriptionResource.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogCollection.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.Serialization.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Argument.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Optional.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperation.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperationOfT.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/CatalogTier.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.Serialization.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.Serialization.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityType.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ProvisioningState.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ProviderConstants.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/RestOperations/GeoCatalogsRestOperations.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Azure.ResourceManager.PlanetaryComputer.Tests.csproj create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestBase.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestEnvironment.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test-resources.json create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test.runsettings create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml create mode 100644 sdk/planetarycomputer/ci.mgmt.yml diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer.sln b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer.sln new file mode 100644 index 000000000000..9e3d18da7378 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.PlanetaryComputer.Samples", "samples\Azure.ResourceManager.PlanetaryComputer.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.PlanetaryComputer", "src\Azure.ResourceManager.PlanetaryComputer.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.PlanetaryComputer.Tests", "tests\Azure.ResourceManager.PlanetaryComputer.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes \ No newline at end of file diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Directory.Build.props b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md new file mode 100644 index 000000000000..a99b562d5edd --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -0,0 +1,111 @@ +# Microsoft Azure PlanetaryComputer Management Client Library for .NET + +The `Azure.ResourceManager.PlanetaryComputer` SDK is the **.NET Management Plane SDK** for working with `GeoCatalog` resources under the **PlanetaryComputer** service. + +It supports full **CRUD operations**, as well as **recorded** and **playback testing** using the Azure SDK's standard test framework. + +--- + +## ๐Ÿ“ Project Structure + +``` +sdk/ +โ””โ”€โ”€ planetarycomputer/ + โ””โ”€โ”€ Azure.ResourceManager.PlanetaryComputer/ + โ”œโ”€โ”€ src/ # Generated SDK source code + โ”œโ”€โ”€ tests/ + โ”‚ โ”œโ”€โ”€ Scenario/ + โ”‚ โ”‚ โ””โ”€โ”€ GeoCatalogCollectionTests.cs # Main scenario tests + โ”‚ โ”œโ”€โ”€ PlanetaryComputerManagementTestBase.cs # Base test infrastructure + โ”‚ โ””โ”€โ”€ PlanetaryComputerManagementTestEnvironment.cs + โ”œโ”€โ”€ Azure.ResourceManager.PlanetaryComputer.csproj + โ”œโ”€โ”€ Azure.ResourceManager.PlanetaryComputer.Tests.csproj + โ””โ”€โ”€ assets.json # Required for test recording/playback +``` + +--- + +## ๐Ÿš€ Getting Started + +### ๐Ÿ“ฆ Install the Package + +Install the package via [NuGet](https://www.nuget.org/): + +```bash +dotnet add package Azure.ResourceManager.PlanetaryComputer --prerelease +``` + +--- + +## ๐Ÿ› ๏ธ Prerequisites + +- [.NET SDK 8.0+](https://dotnet.microsoft.com/download) +- [Azure SDK Test Proxy](https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md) + ```bash + dotnet tool install --global Azure.Sdk.Tools.TestProxy + ``` +- Logged in to Azure CLI: + ```bash + az login + ``` +- Set the following environment variables for test execution: + +```bash +$env:AZURE_SUBSCRIPTION_ID = "" +$env:AZURE_TEST_MODE = "Record" # or "Playback" +$env:AZURE_AUTHORITY_HOST = "https://login.microsoftonline.com" +``` + +--- + +## โœ… Supported Tests + +| Test Name | Description | +|----------------------------------|---------------------------------------------| +| `CreateGeoCatalog` | Creates a GeoCatalog | +| `UpdateGeoCatalog` | Updates an existing GeoCatalog | +| `DeleteGeoCatalog` | Deletes a GeoCatalog | +| `GetGeoCatalog` | Retrieves a specific GeoCatalog | +| `ListGeoCatalogsInResourceGroup`| Lists GeoCatalogs in a resource group | +| `ListGeoCatalogsBySubscription` | Lists GeoCatalogs under a subscription | +| `CreateUpdateDeleteGeoCatalog` | Full CRUD scenario combined | + +--- + +## ๐Ÿงช Running Tests + +### โ–ถ๏ธ Record Mode (Live with Azure) + +1. Start the test proxy: + ```bash + test-proxy + ``` +2. Set mode: + ```bash + $env:AZURE_TEST_MODE = "Record" + ``` +3. Run a specific test: + ```bash + dotnet test -f net8.0 --filter "Name=CreateUpdateDeleteGeoCatalog" + ``` +4. Recordings are saved to: + ``` + .azure-sdk-for-net/.assets//net/sdk/PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer/tests/SessionRecords + ``` + +--- + +### โฏ๏ธ Playback Mode (Offline Testing) + +1. Set mode: + ```bash + $env:AZURE_TEST_MODE = "Playback" + ``` +2. (Optional) Restore recordings: + ```bash + test-proxy restore -a ./assets.json + ``` +3. Run test: + ```bash + dotnet test -f net8.0 --filter "Name=CreateUpdateDeleteGeoCatalog" + ``` diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs new file mode 100644 index 000000000000..155bf5e2eb3d --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs @@ -0,0 +1,213 @@ +namespace Azure.ResourceManager.PlanetaryComputer +{ + public partial class GeoCatalogCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected GeoCatalogCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.GeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.GeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class GeoCatalogData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GeoCatalogData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GeoCatalogResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected GeoCatalogResource() { } + public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string catalogName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class PlanetaryComputerExtensions + { + public static Azure.Response GetGeoCatalog(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetGeoCatalogAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogResource GetGeoCatalogResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogCollection GetGeoCatalogs(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetGeoCatalogs(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetGeoCatalogsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.PlanetaryComputer.Mocking +{ + public partial class MockablePlanetaryComputerArmClient : Azure.ResourceManager.ArmResource + { + protected MockablePlanetaryComputerArmClient() { } + public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogResource GetGeoCatalogResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockablePlanetaryComputerResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockablePlanetaryComputerResourceGroupResource() { } + public virtual Azure.Response GetGeoCatalog(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetGeoCatalogAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogCollection GetGeoCatalogs() { throw null; } + } + public partial class MockablePlanetaryComputerSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockablePlanetaryComputerSubscriptionResource() { } + public virtual Azure.Pageable GetGeoCatalogs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetGeoCatalogsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + public static partial class ArmPlanetaryComputerModelFactory + { + public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogData GeoCatalogData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties GeoCatalogProperties(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier? tier = default(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier?), string catalogUri = null, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState?), Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope?)) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoGeneratedDomainNameLabelScope : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoGeneratedDomainNameLabelScope(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope NoReuse { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope ResourceGroupReuse { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope SubscriptionReuse { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope TenantReuse { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CatalogTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CatalogTier(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier Basic { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier right) { throw null; } + public override string ToString() { throw null; } + } + public partial class GeoCatalogPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GeoCatalogPatch() { } + public Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate Identity { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GeoCatalogProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GeoCatalogProperties() { } + public Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } + public string CatalogUri { get { throw null; } } + public Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier? Tier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedServiceIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedServiceIdentityType(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType None { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType SystemAssigned { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType SystemAssignedUserAssigned { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType left, Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType left, Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ManagedServiceIdentityUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedServiceIdentityUpdate() { } + public Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType? Type { get { throw null; } set { } } + public System.Collections.Generic.IDictionary UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs new file mode 100644 index 000000000000..155bf5e2eb3d --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs @@ -0,0 +1,213 @@ +namespace Azure.ResourceManager.PlanetaryComputer +{ + public partial class GeoCatalogCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected GeoCatalogCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.GeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.GeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class GeoCatalogData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GeoCatalogData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GeoCatalogResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected GeoCatalogResource() { } + public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string catalogName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class PlanetaryComputerExtensions + { + public static Azure.Response GetGeoCatalog(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetGeoCatalogAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogResource GetGeoCatalogResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogCollection GetGeoCatalogs(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetGeoCatalogs(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetGeoCatalogsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.PlanetaryComputer.Mocking +{ + public partial class MockablePlanetaryComputerArmClient : Azure.ResourceManager.ArmResource + { + protected MockablePlanetaryComputerArmClient() { } + public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogResource GetGeoCatalogResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockablePlanetaryComputerResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockablePlanetaryComputerResourceGroupResource() { } + public virtual Azure.Response GetGeoCatalog(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetGeoCatalogAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogCollection GetGeoCatalogs() { throw null; } + } + public partial class MockablePlanetaryComputerSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockablePlanetaryComputerSubscriptionResource() { } + public virtual Azure.Pageable GetGeoCatalogs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetGeoCatalogsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + public static partial class ArmPlanetaryComputerModelFactory + { + public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogData GeoCatalogData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties GeoCatalogProperties(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier? tier = default(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier?), string catalogUri = null, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState?), Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope?)) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoGeneratedDomainNameLabelScope : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoGeneratedDomainNameLabelScope(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope NoReuse { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope ResourceGroupReuse { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope SubscriptionReuse { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope TenantReuse { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CatalogTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CatalogTier(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier Basic { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier right) { throw null; } + public override string ToString() { throw null; } + } + public partial class GeoCatalogPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GeoCatalogPatch() { } + public Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate Identity { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GeoCatalogProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GeoCatalogProperties() { } + public Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } + public string CatalogUri { get { throw null; } } + public Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier? Tier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedServiceIdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedServiceIdentityType(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType None { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType SystemAssigned { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType SystemAssignedUserAssigned { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType left, Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType left, Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ManagedServiceIdentityUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedServiceIdentityUpdate() { } + public Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType? Type { get { throw null; } set { } } + public System.Collections.Generic.IDictionary UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json new file mode 100644 index 000000000000..32f3501ad879 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json @@ -0,0 +1,8 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer", + "Tag": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer_0827ee99b3", + "ServiceDirectory": "planetarycomputer", + "SessionRecordsDirectory": "SessionRecords" + } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Azure.ResourceManager.PlanetaryComputer.Samples.csproj b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Azure.ResourceManager.PlanetaryComputer.Samples.csproj new file mode 100644 index 000000000000..9afe1f52866d --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Azure.ResourceManager.PlanetaryComputer.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/GeneratedSamples.csproj b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/GeneratedSamples.csproj new file mode 100644 index 000000000000..7ee7af72add3 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/GeneratedSamples.csproj @@ -0,0 +1,21 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + + + + + + + + diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogCollection.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogCollection.cs new file mode 100644 index 000000000000..cdc6996c9ae2 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogCollection.cs @@ -0,0 +1,212 @@ +// 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.Models; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.PlanetaryComputer.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.PlanetaryComputer.Samples +{ + public partial class Sample_GeoCatalogCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_GeoCatalogsCreate() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Create.json + // this example is just showing the usage of "GeoCatalog_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GeoCatalogResource + GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + + // invoke the operation + string catalogName = "MyCatalog"; + GeoCatalogData data = new GeoCatalogData(new AzureLocation("eastus")) + { + Properties = new GeoCatalogProperties + { + Tier = CatalogTier.Basic, + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.NoReuse, + }, + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/ac9a1867-7476-4346-bf8b-968370fe212c/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity")] = new UserAssignedIdentity() +}, + }, + Tags = +{ +["MyTag"] = "MyValue" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + GeoCatalogResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GeoCatalogsGet() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json + // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GeoCatalogResource + GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + + // invoke the operation + string catalogName = "MyCatalog"; + GeoCatalogResource result = await collection.GetAsync(catalogName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_GeoCatalogsListByResourceGroup() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_ListByResourceGroup.json + // this example is just showing the usage of "GeoCatalog_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GeoCatalogResource + GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + + // invoke the operation and iterate over the result + await foreach (GeoCatalogResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GeoCatalogsGet() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json + // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GeoCatalogResource + GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + + // invoke the operation + string catalogName = "MyCatalog"; + bool result = await collection.ExistsAsync(catalogName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GeoCatalogsGet() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json + // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GeoCatalogResource + GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + + // invoke the operation + string catalogName = "MyCatalog"; + NullableResponse response = await collection.GetIfExistsAsync(catalogName); + GeoCatalogResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogResource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogResource.cs new file mode 100644 index 000000000000..34ace5aac654 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogResource.cs @@ -0,0 +1,122 @@ +// 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.Models; +using Azure.ResourceManager.PlanetaryComputer.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.PlanetaryComputer.Samples +{ + public partial class Sample_GeoCatalogResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GeoCatalogsGet() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json + // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this GeoCatalogResource created on azure + // for more information of creating GeoCatalogResource, please refer to the document of GeoCatalogResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + string catalogName = "MyCatalog"; + ResourceIdentifier geoCatalogResourceId = GeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); + GeoCatalogResource geoCatalog = client.GetGeoCatalogResource(geoCatalogResourceId); + + // invoke the operation + GeoCatalogResource result = await geoCatalog.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_GeoCatalogsDelete() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Delete.json + // this example is just showing the usage of "GeoCatalog_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this GeoCatalogResource created on azure + // for more information of creating GeoCatalogResource, please refer to the document of GeoCatalogResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + string catalogName = "MyCatalog"; + ResourceIdentifier geoCatalogResourceId = GeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); + GeoCatalogResource geoCatalog = client.GetGeoCatalogResource(geoCatalogResourceId); + + // invoke the operation + await geoCatalog.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_GeoCatalogsUpdate() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Update.json + // this example is just showing the usage of "GeoCatalog_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this GeoCatalogResource created on azure + // for more information of creating GeoCatalogResource, please refer to the document of GeoCatalogResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + string resourceGroupName = "MyResourceGroup"; + string catalogName = "MyCatalog"; + ResourceIdentifier geoCatalogResourceId = GeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); + GeoCatalogResource geoCatalog = client.GetGeoCatalogResource(geoCatalogResourceId); + + // invoke the operation + GeoCatalogPatch patch = new GeoCatalogPatch + { + Tags = +{ +["MyTag"] = "MyValue" +}, + Identity = new ManagedServiceIdentityUpdate + { + Type = Models.ManagedServiceIdentityType.UserAssigned, + UserAssignedIdentities = +{ +["/subscriptions/ac9a1867-7476-4346-bf8b-968370fe212c/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity"] = new UserAssignedIdentity() +}, + }, + }; + ArmOperation lro = await geoCatalog.UpdateAsync(WaitUntil.Completed, patch); + GeoCatalogResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..f60adfb6971d --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.PlanetaryComputer.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetGeoCatalogs_GeoCatalogsListBySubscription() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_ListBySubscription.json + // this example is just showing the usage of "GeoCatalog_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (GeoCatalogResource item in subscriptionResource.GetGeoCatalogsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Azure.ResourceManager.PlanetaryComputer.csproj b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Azure.ResourceManager.PlanetaryComputer.csproj new file mode 100644 index 000000000000..da5b0f0990ab --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Azure.ResourceManager.PlanetaryComputer.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider PlanetaryComputer. + 1.0.0-beta.1 + azure;management;arm;resource manager;PlanetaryComputer + Azure.ResourceManager.PlanetaryComputer + + diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ArmPlanetaryComputerModelFactory.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ArmPlanetaryComputerModelFactory.cs new file mode 100644 index 000000000000..c0cf1974e871 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ArmPlanetaryComputerModelFactory.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// Model factory for models. + public static partial class ArmPlanetaryComputerModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. + /// A new instance for mocking. + public static GeoCatalogData GeoCatalogData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GeoCatalogProperties properties = null, ManagedServiceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new GeoCatalogData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Tier of the catalog. This cannot be changed after the catalog is created. If not provided, defaults to Basic. + /// The URI of the catalog management UI. + /// The status of the last operation. + /// The scope of the auto-generated domain name label. If not provided, defaults to TenantReuse. + /// A new instance for mocking. + public static GeoCatalogProperties GeoCatalogProperties(CatalogTier? tier = null, string catalogUri = null, ProvisioningState? provisioningState = null, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = null) + { + return new GeoCatalogProperties(tier, catalogUri, provisioningState, autoGeneratedDomainNameLabelScope, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerArmClient.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerArmClient.cs new file mode 100644 index 000000000000..ac41b6df6e77 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerArmClient.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockablePlanetaryComputerArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockablePlanetaryComputerArmClient() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockablePlanetaryComputerArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockablePlanetaryComputerArmClient(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 GeoCatalogResource GetGeoCatalogResource(ResourceIdentifier id) + { + GeoCatalogResource.ValidateResourceId(id); + return new GeoCatalogResource(Client, id); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerResourceGroupResource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerResourceGroupResource.cs new file mode 100644 index 000000000000..88c144c45dce --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerResourceGroupResource.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockablePlanetaryComputerResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockablePlanetaryComputerResourceGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockablePlanetaryComputerResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of GeoCatalogResources in the ResourceGroupResource. + /// An object representing collection of GeoCatalogResources and their operations over a GeoCatalogResource. + public virtual GeoCatalogCollection GetGeoCatalogs() + { + return GetCachedClient(client => new GeoCatalogCollection(client, Id)); + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGeoCatalogAsync(string catalogName, CancellationToken cancellationToken = default) + { + return await GetGeoCatalogs().GetAsync(catalogName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGeoCatalog(string catalogName, CancellationToken cancellationToken = default) + { + return GetGeoCatalogs().Get(catalogName, cancellationToken); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerSubscriptionResource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerSubscriptionResource.cs new file mode 100644 index 000000000000..b657209ab2c4 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerSubscriptionResource.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.PlanetaryComputer.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockablePlanetaryComputerSubscriptionResource : ArmResource + { + private ClientDiagnostics _geoCatalogClientDiagnostics; + private GeoCatalogsRestOperations _geoCatalogRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockablePlanetaryComputerSubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockablePlanetaryComputerSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics GeoCatalogClientDiagnostics => _geoCatalogClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.PlanetaryComputer", GeoCatalogResource.ResourceType.Namespace, Diagnostics); + private GeoCatalogsRestOperations GeoCatalogRestClient => _geoCatalogRestClient ??= new GeoCatalogsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(GeoCatalogResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List GeoCatalog resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Orbital/geoCatalogs + /// + /// + /// Operation Id + /// GeoCatalog_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetGeoCatalogsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => GeoCatalogRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GeoCatalogRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GeoCatalogResource(Client, GeoCatalogData.DeserializeGeoCatalogData(e)), GeoCatalogClientDiagnostics, Pipeline, "MockablePlanetaryComputerSubscriptionResource.GetGeoCatalogs", "value", "nextLink", cancellationToken); + } + + /// + /// List GeoCatalog resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Orbital/geoCatalogs + /// + /// + /// Operation Id + /// GeoCatalog_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetGeoCatalogs(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => GeoCatalogRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GeoCatalogRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GeoCatalogResource(Client, GeoCatalogData.DeserializeGeoCatalogData(e)), GeoCatalogClientDiagnostics, Pipeline, "MockablePlanetaryComputerSubscriptionResource.GetGeoCatalogs", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs new file mode 100644 index 000000000000..c95ac251b794 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.PlanetaryComputer.Mocking; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + /// A class to add extension methods to Azure.ResourceManager.PlanetaryComputer. + public static partial class PlanetaryComputerExtensions + { + private static MockablePlanetaryComputerArmClient GetMockablePlanetaryComputerArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockablePlanetaryComputerArmClient(client0)); + } + + private static MockablePlanetaryComputerResourceGroupResource GetMockablePlanetaryComputerResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockablePlanetaryComputerResourceGroupResource(client, resource.Id)); + } + + private static MockablePlanetaryComputerSubscriptionResource GetMockablePlanetaryComputerSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockablePlanetaryComputerSubscriptionResource(client, resource.Id)); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static GeoCatalogResource GetGeoCatalogResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockablePlanetaryComputerArmClient(client).GetGeoCatalogResource(id); + } + + /// + /// Gets a collection of GeoCatalogResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of GeoCatalogResources and their operations over a GeoCatalogResource. + public static GeoCatalogCollection GetGeoCatalogs(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockablePlanetaryComputerResourceGroupResource(resourceGroupResource).GetGeoCatalogs(); + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the catalog. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetGeoCatalogAsync(this ResourceGroupResource resourceGroupResource, string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockablePlanetaryComputerResourceGroupResource(resourceGroupResource).GetGeoCatalogAsync(catalogName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the catalog. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetGeoCatalog(this ResourceGroupResource resourceGroupResource, string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockablePlanetaryComputerResourceGroupResource(resourceGroupResource).GetGeoCatalog(catalogName, cancellationToken); + } + + /// + /// List GeoCatalog resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Orbital/geoCatalogs + /// + /// + /// Operation Id + /// GeoCatalog_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetGeoCatalogsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockablePlanetaryComputerSubscriptionResource(subscriptionResource).GetGeoCatalogsAsync(cancellationToken); + } + + /// + /// List GeoCatalog resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Orbital/geoCatalogs + /// + /// + /// Operation Id + /// GeoCatalog_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetGeoCatalogs(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockablePlanetaryComputerSubscriptionResource(subscriptionResource).GetGeoCatalogs(cancellationToken); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogCollection.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogCollection.cs new file mode 100644 index 000000000000..e4e0c9b75739 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogCollection.cs @@ -0,0 +1,499 @@ + + + + + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetGeoCatalogs method from an instance of . + /// + public partial class GeoCatalogCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _geoCatalogClientDiagnostics; + private readonly GeoCatalogsRestOperations _geoCatalogRestClient; + + /// Initializes a new instance of the class for mocking. + protected GeoCatalogCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal GeoCatalogCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _geoCatalogClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PlanetaryComputer", GeoCatalogResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(GeoCatalogResource.ResourceType, out string geoCatalogApiVersion); + _geoCatalogRestClient = new GeoCatalogsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, geoCatalogApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Create + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the catalog. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string catalogName, GeoCatalogData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _geoCatalogRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data, cancellationToken).ConfigureAwait(false); + var operation = new PlanetaryComputerArmOperation(new GeoCatalogOperationSource(Client), _geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Create + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the catalog. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string catalogName, GeoCatalogData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _geoCatalogRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data, cancellationToken); + var operation = new PlanetaryComputerArmOperation(new GeoCatalogOperationSource(Client), _geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.Get"); + scope.Start(); + try + { + var response = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.Get"); + scope.Start(); + try + { + var response = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List GeoCatalog resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs + /// + /// + /// Operation Id + /// GeoCatalog_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _geoCatalogRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _geoCatalogRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GeoCatalogResource(Client, GeoCatalogData.DeserializeGeoCatalogData(e)), _geoCatalogClientDiagnostics, Pipeline, "GeoCatalogCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List GeoCatalog resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs + /// + /// + /// Operation Id + /// GeoCatalog_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _geoCatalogRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _geoCatalogRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GeoCatalogResource(Client, GeoCatalogData.DeserializeGeoCatalogData(e)), _geoCatalogClientDiagnostics, Pipeline, "GeoCatalogCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.Exists"); + scope.Start(); + try + { + var response = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.Exists"); + scope.Start(); + try + { + var response = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the catalog. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.GetIfExists"); + scope.Start(); + try + { + var response = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.Serialization.cs new file mode 100644 index 000000000000..d59e0a915a98 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PlanetaryComputer.Models; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + public partial class GeoCatalogData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + } + + GeoCatalogData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGeoCatalogData(document.RootElement, options); + } + + internal static GeoCatalogData DeserializeGeoCatalogData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + GeoCatalogProperties properties = default; + ManagedServiceIdentity identity = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = GeoCatalogProperties.DeserializeGeoCatalogProperties(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GeoCatalogData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + identity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GeoCatalogData)} does not support writing '{options.Format}' format."); + } + } + + GeoCatalogData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGeoCatalogData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GeoCatalogData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.cs new file mode 100644 index 000000000000..5360bb55ddd9 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.PlanetaryComputer.Models; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + /// + /// A class representing the GeoCatalog data model. + /// A MPC Pro catalog resource + /// + public partial class GeoCatalogData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public GeoCatalogData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. + /// Keeps track of any properties unknown to the library. + internal GeoCatalogData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GeoCatalogProperties properties, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GeoCatalogData() + { + } + + /// The resource-specific properties for this resource. + public GeoCatalogProperties Properties { get; set; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs new file mode 100644 index 000000000000..9676d94f8089 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + public partial class GeoCatalogResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + GeoCatalogData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + GeoCatalogData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.cs new file mode 100644 index 000000000000..06508dcea103 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.cs @@ -0,0 +1,707 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.PlanetaryComputer.Models; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + /// + /// A Class representing a GeoCatalog along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetGeoCatalogResource method. + /// Otherwise you can get one from its parent resource using the GetGeoCatalog method. + /// + public partial class GeoCatalogResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The catalogName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string catalogName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _geoCatalogClientDiagnostics; + private readonly GeoCatalogsRestOperations _geoCatalogRestClient; + private readonly GeoCatalogData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Orbital/geoCatalogs"; + + /// Initializes a new instance of the class for mocking. + protected GeoCatalogResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal GeoCatalogResource(ArmClient client, GeoCatalogData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal GeoCatalogResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _geoCatalogClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PlanetaryComputer", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string geoCatalogApiVersion); + _geoCatalogRestClient = new GeoCatalogsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, geoCatalogApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual GeoCatalogData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Get"); + scope.Start(); + try + { + var response = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Get"); + scope.Start(); + try + { + var response = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Delete + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Delete"); + scope.Start(); + try + { + var response = await _geoCatalogRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new PlanetaryComputerArmOperation(_geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Delete + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Delete"); + scope.Start(); + try + { + var response = _geoCatalogRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new PlanetaryComputerArmOperation(_geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Update + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, GeoCatalogPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Update"); + scope.Start(); + try + { + var response = await _geoCatalogRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new PlanetaryComputerArmOperation(new GeoCatalogOperationSource(Client), _geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a GeoCatalog + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Update + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, GeoCatalogPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Update"); + scope.Start(); + try + { + var response = _geoCatalogRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new PlanetaryComputerArmOperation(new GeoCatalogOperationSource(Client), _geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new GeoCatalogPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new GeoCatalogPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new GeoCatalogPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new GeoCatalogPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new GeoCatalogPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Orbital/geoCatalogs/{catalogName} + /// + /// + /// Operation Id + /// GeoCatalog_Get + /// + /// + /// Default Api Version + /// 2025-02-11-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new GeoCatalogPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Argument.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..6b7d943b8f10 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..6ecf5ab75a82 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingList.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..00588c1b682b --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..55cbebcc8aec --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,399 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal static class ModelSerializationExtensions + { + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Optional.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..8664b8d56939 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..b2caaa7f97ed --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs new file mode 100644 index 000000000000..71a167a6551d --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal class GeoCatalogOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal GeoCatalogOperationSource(ArmClient client) + { + _client = client; + } + + GeoCatalogResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new GeoCatalogResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new GeoCatalogResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperation.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperation.cs new file mode 100644 index 000000000000..24e38640c289 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperation.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.PlanetaryComputer +{ +#pragma warning disable SA1649 // File name should match first type name + internal class PlanetaryComputerArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of PlanetaryComputerArmOperation for mocking. + protected PlanetaryComputerArmOperation() + { + } + + internal PlanetaryComputerArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal PlanetaryComputerArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "PlanetaryComputerArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperationOfT.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperationOfT.cs new file mode 100644 index 000000000000..a01b9da93997 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperationOfT.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.PlanetaryComputer +{ +#pragma warning disable SA1649 // File name should match first type name + internal class PlanetaryComputerArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of PlanetaryComputerArmOperation for mocking. + protected PlanetaryComputerArmOperation() + { + } + + internal PlanetaryComputerArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal PlanetaryComputerArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "PlanetaryComputerArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs new file mode 100644 index 000000000000..0857b5b7a812 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// The scope at which the auto-generated domain name label is generated and at which the resource name can be reused. + public readonly partial struct AutoGeneratedDomainNameLabelScope : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutoGeneratedDomainNameLabelScope(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoReuseValue = "NoReuse"; + private const string TenantReuseValue = "TenantReuse"; + private const string SubscriptionReuseValue = "SubscriptionReuse"; + private const string ResourceGroupReuseValue = "ResourceGroupReuse"; + + /// The domain name label is randomly generated. The resource name cannot be reused within the same region. + public static AutoGeneratedDomainNameLabelScope NoReuse { get; } = new AutoGeneratedDomainNameLabelScope(NoReuseValue); + /// The domain name label is deterministically generated using the resource name and tenant id. The resource name cannot be reused within the same region and tenant. + public static AutoGeneratedDomainNameLabelScope TenantReuse { get; } = new AutoGeneratedDomainNameLabelScope(TenantReuseValue); + /// The domain name label is deterministically generated using the resource name, tenant id, and subscription id. The resource name cannot be reused within the same region and subscription. + public static AutoGeneratedDomainNameLabelScope SubscriptionReuse { get; } = new AutoGeneratedDomainNameLabelScope(SubscriptionReuseValue); + /// The domain name label is deterministically generated using the resource name, tenant id, subscription id, and resource group name. The resource name cannot be reused within the same resource group. + public static AutoGeneratedDomainNameLabelScope ResourceGroupReuse { get; } = new AutoGeneratedDomainNameLabelScope(ResourceGroupReuseValue); + /// Determines if two values are the same. + public static bool operator ==(AutoGeneratedDomainNameLabelScope left, AutoGeneratedDomainNameLabelScope right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutoGeneratedDomainNameLabelScope left, AutoGeneratedDomainNameLabelScope right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutoGeneratedDomainNameLabelScope(string value) => new AutoGeneratedDomainNameLabelScope(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutoGeneratedDomainNameLabelScope other && Equals(other); + /// + public bool Equals(AutoGeneratedDomainNameLabelScope other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/CatalogTier.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/CatalogTier.cs new file mode 100644 index 000000000000..24f63bb55fbd --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/CatalogTier.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// The Microsoft Planetary Computer Pro GeoCatalog tier. + public readonly partial struct CatalogTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CatalogTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BasicValue = "Basic"; + + /// The basic tier that utilizes shared resources across catalog instances. + public static CatalogTier Basic { get; } = new CatalogTier(BasicValue); + /// Determines if two values are the same. + public static bool operator ==(CatalogTier left, CatalogTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CatalogTier left, CatalogTier right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CatalogTier(string value) => new CatalogTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CatalogTier other && Equals(other); + /// + public bool Equals(CatalogTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs new file mode 100644 index 000000000000..5e6be2bcb7da --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + internal partial class GeoCatalogListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GeoCatalogListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGeoCatalogListResult(document.RootElement, options); + } + + internal static GeoCatalogListResult DeserializeGeoCatalogListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(GeoCatalogData.DeserializeGeoCatalogData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GeoCatalogListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GeoCatalogListResult)} does not support writing '{options.Format}' format."); + } + } + + GeoCatalogListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGeoCatalogListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GeoCatalogListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.cs new file mode 100644 index 000000000000..23354a592930 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// The response of a GeoCatalog list operation. + internal partial class GeoCatalogListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The GeoCatalog items on this page. + /// is null. + internal GeoCatalogListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The GeoCatalog items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal GeoCatalogListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GeoCatalogListResult() + { + } + + /// The GeoCatalog items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.Serialization.cs new file mode 100644 index 000000000000..d368659d1c95 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + public partial class GeoCatalogPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GeoCatalogPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGeoCatalogPatch(document.RootElement, options); + } + + internal static GeoCatalogPatch DeserializeGeoCatalogPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + ManagedServiceIdentityUpdate identity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = ManagedServiceIdentityUpdate.DeserializeManagedServiceIdentityUpdate(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GeoCatalogPatch(tags ?? new ChangeTrackingDictionary(), identity, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GeoCatalogPatch)} does not support writing '{options.Format}' format."); + } + } + + GeoCatalogPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGeoCatalogPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GeoCatalogPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.cs new file mode 100644 index 000000000000..789eb911cc8e --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// Patch request workaround for Swagger LintDiff. Typespec Bug: https://github.com/Azure/typespec-azure/issues/383. + public partial class GeoCatalogPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public GeoCatalogPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Updatable managed service identity. + /// Keeps track of any properties unknown to the library. + internal GeoCatalogPatch(IDictionary tags, ManagedServiceIdentityUpdate identity, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// Updatable managed service identity. + public ManagedServiceIdentityUpdate Identity { get; set; } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.Serialization.cs new file mode 100644 index 000000000000..ba5237f17430 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + public partial class GeoCatalogProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Tier)) + { + writer.WritePropertyName("tier"u8); + writer.WriteStringValue(Tier.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CatalogUri)) + { + writer.WritePropertyName("catalogUri"u8); + writer.WriteStringValue(CatalogUri); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(AutoGeneratedDomainNameLabelScope)) + { + writer.WritePropertyName("autoGeneratedDomainNameLabelScope"u8); + writer.WriteStringValue(AutoGeneratedDomainNameLabelScope.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GeoCatalogProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GeoCatalogProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGeoCatalogProperties(document.RootElement, options); + } + + internal static GeoCatalogProperties DeserializeGeoCatalogProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CatalogTier? tier = default; + string catalogUri = default; + ProvisioningState? provisioningState = default; + AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tier = new CatalogTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("catalogUri"u8)) + { + catalogUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("autoGeneratedDomainNameLabelScope"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoGeneratedDomainNameLabelScope = new AutoGeneratedDomainNameLabelScope(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GeoCatalogProperties(tier, catalogUri, provisioningState, autoGeneratedDomainNameLabelScope, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GeoCatalogProperties)} does not support writing '{options.Format}' format."); + } + } + + GeoCatalogProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGeoCatalogProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GeoCatalogProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.cs new file mode 100644 index 000000000000..35bbc74e5624 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// Details of the MPC Pro GeoCatalog. + public partial class GeoCatalogProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public GeoCatalogProperties() + { + } + + /// Initializes a new instance of . + /// Tier of the catalog. This cannot be changed after the catalog is created. If not provided, defaults to Basic. + /// The URI of the catalog management UI. + /// The status of the last operation. + /// The scope of the auto-generated domain name label. If not provided, defaults to TenantReuse. + /// Keeps track of any properties unknown to the library. + internal GeoCatalogProperties(CatalogTier? tier, string catalogUri, ProvisioningState? provisioningState, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope, IDictionary serializedAdditionalRawData) + { + Tier = tier; + CatalogUri = catalogUri; + ProvisioningState = provisioningState; + AutoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Tier of the catalog. This cannot be changed after the catalog is created. If not provided, defaults to Basic. + public CatalogTier? Tier { get; set; } + /// The URI of the catalog management UI. + public string CatalogUri { get; } + /// The status of the last operation. + public ProvisioningState? ProvisioningState { get; } + /// The scope of the auto-generated domain name label. If not provided, defaults to TenantReuse. + public AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get; set; } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityType.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityType.cs new file mode 100644 index 000000000000..4faeefdaba2f --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + public readonly partial struct ManagedServiceIdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedServiceIdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string SystemAssignedValue = "SystemAssigned"; + private const string UserAssignedValue = "UserAssigned"; + private const string SystemAssignedUserAssignedValue = "SystemAssigned,UserAssigned"; + + /// No managed identity. + public static ManagedServiceIdentityType None { get; } = new ManagedServiceIdentityType(NoneValue); + /// System assigned managed identity. + public static ManagedServiceIdentityType SystemAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedValue); + /// User assigned managed identity. + public static ManagedServiceIdentityType UserAssigned { get; } = new ManagedServiceIdentityType(UserAssignedValue); + /// System and user assigned managed identity. + public static ManagedServiceIdentityType SystemAssignedUserAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedUserAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ManagedServiceIdentityType(string value) => new ManagedServiceIdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedServiceIdentityType other && Equals(other); + /// + public bool Equals(ManagedServiceIdentityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs new file mode 100644 index 000000000000..ef1cda0bb846 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + public partial class ManagedServiceIdentityUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedServiceIdentityUpdate)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } + if (Optional.IsCollectionDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"u8); + writer.WriteStartObject(); + foreach (var item in UserAssignedIdentities) + { + writer.WritePropertyName(item.Key); + JsonSerializer.Serialize(writer, item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ManagedServiceIdentityUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedServiceIdentityUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedServiceIdentityUpdate(document.RootElement, options); + } + + internal static ManagedServiceIdentityUpdate DeserializeManagedServiceIdentityUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentityType? type = default; + IDictionary userAssignedIdentities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ManagedServiceIdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, JsonSerializer.Deserialize(property0.Value.GetRawText())); + } + userAssignedIdentities = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedServiceIdentityUpdate(type, userAssignedIdentities ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedServiceIdentityUpdate)} does not support writing '{options.Format}' format."); + } + } + + ManagedServiceIdentityUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedServiceIdentityUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedServiceIdentityUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.cs new file mode 100644 index 000000000000..cfdd66dcd7c1 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// The template for adding optional properties. + public partial class ManagedServiceIdentityUpdate + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ManagedServiceIdentityUpdate() + { + UserAssignedIdentities = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The type of managed identity assigned to this resource. + /// The identities assigned to this resource by the user. + /// Keeps track of any properties unknown to the library. + internal ManagedServiceIdentityUpdate(ManagedServiceIdentityType? type, IDictionary userAssignedIdentities, IDictionary serializedAdditionalRawData) + { + Type = type; + UserAssignedIdentities = userAssignedIdentities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of managed identity assigned to this resource. + public ManagedServiceIdentityType? Type { get; set; } + /// The identities assigned to this resource by the user. + public IDictionary UserAssignedIdentities { get; } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ProvisioningState.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..3082d5771f8c --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// The status of the current operation. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + + /// Resource has been created. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Resource creation failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// The catalog is being provisioned. + public static ProvisioningState Provisioning { get; } = new ProvisioningState(ProvisioningValue); + /// The catalog is being updated. + public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); + /// The catalog is being deleted. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// The catalog request has been accepted. + public static ProvisioningState Accepted { get; } = new ProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); + /// + public bool Equals(ProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ProviderConstants.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..5056bd5a11f7 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/RestOperations/GeoCatalogsRestOperations.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/RestOperations/GeoCatalogsRestOperations.cs new file mode 100644 index 000000000000..9f515e77664d --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/RestOperations/GeoCatalogsRestOperations.cs @@ -0,0 +1,723 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.PlanetaryComputer.Models; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal partial class GeoCatalogsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of GeoCatalogsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public GeoCatalogsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-11-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string catalogName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string catalogName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, catalogName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GeoCatalogData.DeserializeGeoCatalogData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GeoCatalogData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, catalogName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GeoCatalogData.DeserializeGeoCatalogData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GeoCatalogData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, catalogName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, catalogName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, catalogName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string catalogName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string catalogName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs/", false); + uri.AppendPath(catalogName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a GeoCatalog. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the catalog. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string catalogName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, catalogName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List GeoCatalog resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List GeoCatalog resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Orbital/geoCatalogs", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List GeoCatalog resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List GeoCatalog resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List GeoCatalog resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List GeoCatalog resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List GeoCatalog resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List GeoCatalog resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GeoCatalogListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GeoCatalogListResult.DeserializeGeoCatalogListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..924e36b542b1 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.PlanetaryComputer.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("PlanetaryComputer")] diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Azure.ResourceManager.PlanetaryComputer.Tests.csproj b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Azure.ResourceManager.PlanetaryComputer.Tests.csproj new file mode 100644 index 000000000000..15a4d54cdc27 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Azure.ResourceManager.PlanetaryComputer.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestBase.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestBase.cs new file mode 100644 index 000000000000..cc704476bfd9 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.PlanetaryComputer.Tests +{ + public class PlanetaryComputerManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected PlanetaryComputerManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected PlanetaryComputerManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestEnvironment.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestEnvironment.cs new file mode 100644 index 000000000000..36816598185e --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/PlanetaryComputerManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.PlanetaryComputer.Tests +{ + public class PlanetaryComputerManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs new file mode 100644 index 000000000000..b7e797fdb2d4 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.PlanetaryComputer; +using Azure.ResourceManager.PlanetaryComputer.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.PlanetaryComputer.Tests +{ + [TestFixture(true)] + public class GeoCatalogCollectionTests : PlanetaryComputerManagementTestBase + { + // Add an exsiting geocatalo + private const string ExistingGeoCatalogName = ""; + private const string ResourceGroupName = "shakrao-test"; + private const string Region = "uksouth"; + + public GeoCatalogCollectionTests(bool isAsync) + : base(isAsync) // <-- Forces Record mode explicitly + { + } + + [Test] + [RecordedTest] + public async Task ListGeoCatalogsInResourceGroup() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + ResourceGroupResource rg = await subscription.GetResourceGroups().GetAsync(ResourceGroupName); + GeoCatalogCollection collection = rg.GetGeoCatalogs(); + + int count = 0; + await foreach (GeoCatalogResource item in collection.GetAllAsync()) + { + TestContext.WriteLine($"GeoCatalog: {item.Data.Name}"); + count++; + } + + Assert.GreaterOrEqual(count, 0); + } + + [Test] + [RecordedTest] + public async Task GetGeoCatalog() + { + if (string.IsNullOrEmpty(ExistingGeoCatalogName)) + { + Assert.Inconclusive("No existing GeoCatalog name provided."); + return; + } + + GeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); + GeoCatalogResource catalog = await collection.GetAsync(ExistingGeoCatalogName); + + Assert.AreEqual(ExistingGeoCatalogName, catalog.Data.Name); + Assert.AreEqual(Region.ToLowerInvariant(), catalog.Data.Location.ToString().ToLowerInvariant()); + TestContext.WriteLine($"Catalog URI: {catalog.Data.Properties.CatalogUri}"); + } + + [Test] + [RecordedTest] + public async Task CreateGeoCatalog() + { + string catalogName = Recording.GenerateAssetName("testcatalog-"); + GeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); + GeoCatalogData data = new GeoCatalogData(new AzureLocation(Region)) + { + Identity = new ManagedServiceIdentity(Azure.ResourceManager.Models.ManagedServiceIdentityType.UserAssigned) + { + UserAssignedIdentities = + { + [new ResourceIdentifier($"/subscriptions/{Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID")}/resourceGroups/{Environment.GetEnvironmentVariable("AZURE_RESOURCE_GROUP")}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{Environment.GetEnvironmentVariable("AZURE_IDENTITY_NAME")}")] = new UserAssignedIdentity() + } + }, + Properties = new GeoCatalogProperties + { + Tier = CatalogTier.Basic, + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.TenantReuse + }, + Tags = { ["env"] = "test" } + }; + + ArmOperation operation = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + GeoCatalogResource result = operation.Value; + + Assert.AreEqual(catalogName, result.Data.Name); + Assert.AreEqual(CatalogTier.Basic, result.Data.Properties.Tier); + TestContext.WriteLine($"Created GeoCatalog: {result.Id}"); + } + + [Test] + [RecordedTest] + public async Task UpdateGeoCatalog() + { + string catalogName = Recording.GenerateAssetName("testcatalog-"); + GeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); + + GeoCatalogData data = new GeoCatalogData(new AzureLocation(Region)) + { + Properties = new GeoCatalogProperties + { + Tier = CatalogTier.Basic, + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.TenantReuse + }, + Tags = { ["env"] = "initial" } + }; + + ArmOperation createOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + GeoCatalogResource resource = createOp.Value; + + resource.Data.Tags["env"] = "updated"; + ArmOperation updateOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, resource.Data); + GeoCatalogResource updated = updateOp.Value; + + Assert.AreEqual("updated", updated.Data.Tags["env"]); + TestContext.WriteLine($"Updated GeoCatalog: {updated.Id}"); + } + + [Test] + [RecordedTest] + public async Task DeleteGeoCatalog() + { + string catalogName = Recording.GenerateAssetName("testcatalog-"); + GeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); + + GeoCatalogData data = new GeoCatalogData(new AzureLocation(Region)) + { + Properties = new GeoCatalogProperties + { + Tier = CatalogTier.Basic, + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.TenantReuse + }, + Tags = { ["env"] = "delete" } + }; + + ArmOperation createOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + GeoCatalogResource resource = createOp.Value; + + ArmOperation deleteOp = await resource.DeleteAsync(WaitUntil.Completed); + Assert.IsTrue(deleteOp.HasCompleted); + + bool exists = await collection.ExistsAsync(catalogName); + Assert.IsFalse(exists); + TestContext.WriteLine($"Deleted GeoCatalog: {catalogName}"); + } + + [Test] + [RecordedTest] + public async Task ListGeoCatalogsBySubscription() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + AsyncPageable catalogs = subscription.GetGeoCatalogsAsync(); + + int count = 0; + await foreach (GeoCatalogResource item in catalogs) + { + TestContext.WriteLine($"[Subscription List] GeoCatalog: {item.Data.Name}"); + count++; + } + Assert.GreaterOrEqual(count, 0); + } + [Test] + [RecordedTest] + public async Task CreateUpdateDeleteGeoCatalog() + { + Console.WriteLine($"[MODE] Test is running in: {TestEnvironment.Mode}"); + + string catalogName = Recording.GenerateAssetName("testcatalog-"); + GeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); + + // Step 1: Create + GeoCatalogData data = new GeoCatalogData(new AzureLocation(Region)) + { + Properties = new GeoCatalogProperties + { + Tier = CatalogTier.Basic, + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.TenantReuse + }, + Tags = { ["env"] = "initial" } + }; + + ArmOperation createOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + GeoCatalogResource resource = createOp.Value; + + Assert.AreEqual("initial", resource.Data.Tags["env"]); + TestContext.WriteLine($"โœ… Created GeoCatalog: {resource.Id}"); + + // Step 2: Update + resource.Data.Tags["env"] = "updated"; + ArmOperation updateOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, resource.Data); + GeoCatalogResource updated = updateOp.Value; + + Assert.AreEqual("updated", updated.Data.Tags["env"]); + TestContext.WriteLine($"๐Ÿ”„ Updated GeoCatalog: {updated.Id}"); + + // Step 3: Delete + ArmOperation deleteOp = await updated.DeleteAsync(WaitUntil.Completed); + Assert.IsTrue(deleteOp.HasCompleted); + + bool exists = await collection.ExistsAsync(catalogName); + Assert.IsFalse(exists); + TestContext.WriteLine($"โŒ Deleted GeoCatalog: {catalogName}"); + } + + private async Task GetGeoCatalogCollectionAsync() + { + SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); + ResourceGroupResource rg = await subscription.GetResourceGroups().GetAsync(ResourceGroupName); + return rg.GetGeoCatalogs(); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test-resources.json b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test-resources.json new file mode 100644 index 000000000000..ede357a93212 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test-resources.json @@ -0,0 +1,7 @@ +{ + "record": true, + "variables": { + "AZURE_SUBSCRIPTION_ID": "00000000-0000-0000-0000-000000000000", + "AZURE_RESOURCE_GROUP": "test" + } + } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test.runsettings b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test.runsettings new file mode 100644 index 000000000000..4874433e61e2 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/test.runsettings @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml new file mode 100644 index 000000000000..b16d32804f4d --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/spatio/PlanetaryComputerPro +commit: 0d7256e6981a80f797551fd87944458686e447fa +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/planetarycomputer/ci.mgmt.yml b/sdk/planetarycomputer/ci.mgmt.yml new file mode 100644 index 000000000000..93b8b6149a83 --- /dev/null +++ b/sdk/planetarycomputer/ci.mgmt.yml @@ -0,0 +1,30 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/PlanetaryComputer/ci.mgmt.yml + - sdk/PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer/ + +/ci.mgmt.yml + - sdk/PlanetaryComputer +/Azure.ResourceManager.PlanetaryComputer +/ + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: PlanetaryComputer + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.PlanetaryComputer + safeName: AzureResourceManagerPlanetaryComputer diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 023f426435be..75de9d9e649f 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -159,6 +159,7 @@ trigger: - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw - sdk/peering/Azure.ResourceManager.Peering - sdk/pineconevectordb/Azure.ResourceManager.PineconeVectorDB + - sdk/PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting - sdk/policyinsights/Azure.ResourceManager.PolicyInsights - sdk/portalservices/Azure.ResourceManager.PortalServicesCopilot @@ -383,6 +384,7 @@ pr: - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw - sdk/peering/Azure.ResourceManager.Peering - sdk/pineconevectordb/Azure.ResourceManager.PineconeVectorDB + - sdk/PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting - sdk/policyinsights/Azure.ResourceManager.PolicyInsights - sdk/portalservices/Azure.ResourceManager.PortalServicesCopilot From 9fd64645ea71d2e1ff50d43ec10b1eb9a7733dc8 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Tue, 24 Jun 2025 15:00:33 -0700 Subject: [PATCH 17/43] readme update --- .../Azure.ResourceManager.PlanetaryComputer/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index a99b562d5edd..833349748b05 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -54,6 +54,7 @@ dotnet add package Azure.ResourceManager.PlanetaryComputer --prerelease $env:AZURE_SUBSCRIPTION_ID = "" $env:AZURE_TEST_MODE = "Record" # or "Playback" $env:AZURE_AUTHORITY_HOST = "https://login.microsoftonline.com" +$env:AZURE_IDENTITY_NAME = "" ``` --- From bdc0f9ec71b0d9b655baa2554416813cdc722f46 Mon Sep 17 00:00:00 2001 From: Shakti Chetan Rao <55005052+shaktichetan23@users.noreply.github.com> Date: Tue, 24 Jun 2025 12:38:51 -0700 Subject: [PATCH 18/43] Update sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../src/Properties/AssemblyInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs index 924e36b542b1..2b70fe3e4880 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ [assembly: InternalsVisibleTo("Azure.ResourceManager.PlanetaryComputer.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] -// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// Replace Microsoft.Test with the correct resource provider namespace for your service and uncomment. // See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers // for the list of possible values. [assembly: Azure.Core.AzureResourceProviderNamespace("PlanetaryComputer")] From 9c5b029c57055567ee9050b9125c1f753e4b999b Mon Sep 17 00:00:00 2001 From: Shakti Chetan Rao <55005052+shaktichetan23@users.noreply.github.com> Date: Tue, 24 Jun 2025 12:38:58 -0700 Subject: [PATCH 19/43] Update sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../tests/Scenario/GeoCatalogCollectionTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs index b7e797fdb2d4..57cf9daa6c4e 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs @@ -18,7 +18,7 @@ namespace Azure.ResourceManager.PlanetaryComputer.Tests [TestFixture(true)] public class GeoCatalogCollectionTests : PlanetaryComputerManagementTestBase { - // Add an exsiting geocatalo + // Add an existing GeoCatalog private const string ExistingGeoCatalogName = ""; private const string ResourceGroupName = "shakrao-test"; private const string Region = "uksouth"; From e353f01a813a752408234a4ce49967c0799b4048 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Tue, 24 Jun 2025 15:39:27 -0700 Subject: [PATCH 20/43] fix checks --- .../Azure.ResourceManager.PlanetaryComputer/README.md | 2 +- .../Azure.ResourceManager.PlanetaryComputer/assets.json | 2 +- .../tests/Scenario/GeoCatalogCollectionTests.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 833349748b05..2799c5311589 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -37,7 +37,7 @@ dotnet add package Azure.ResourceManager.PlanetaryComputer --prerelease --- -## ๐Ÿ› ๏ธ Prerequisites +### ๐Ÿ› ๏ธ Prerequisites - [.NET SDK 8.0+](https://dotnet.microsoft.com/download) - [Azure SDK Test Proxy](https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json index 32f3501ad879..ef91b34e7abd 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json @@ -2,7 +2,7 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer", - "Tag": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer_0827ee99b3", + "Tag": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer_04278b495e", "ServiceDirectory": "planetarycomputer", "SessionRecordsDirectory": "SessionRecords" } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs index 57cf9daa6c4e..90251d77fd4b 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs @@ -76,7 +76,7 @@ public async Task CreateGeoCatalog() { UserAssignedIdentities = { - [new ResourceIdentifier($"/subscriptions/{Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID")}/resourceGroups/{Environment.GetEnvironmentVariable("AZURE_RESOURCE_GROUP")}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{Environment.GetEnvironmentVariable("AZURE_IDENTITY_NAME")}")] = new UserAssignedIdentity() + [new ResourceIdentifier($"/subscriptions/ac9a1867-7476-4346-bf8b-968370fe212c/resourceGroups/msi-test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-uk-1")] = new UserAssignedIdentity() } }, Properties = new GeoCatalogProperties From 66d82823f4427f8829bf4adc9644ed33633c37f9 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Tue, 24 Jun 2025 16:35:17 -0700 Subject: [PATCH 21/43] fix checks --- .../README.md | 20 +++++++++++-------- .../assets.json | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 2799c5311589..857cda376da9 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -6,7 +6,7 @@ It supports full **CRUD operations**, as well as **recorded** and **playback tes --- -## ๐Ÿ“ Project Structure +## Project Structure ``` sdk/ @@ -25,9 +25,9 @@ sdk/ --- -## ๐Ÿš€ Getting Started +## Getting Started -### ๐Ÿ“ฆ Install the Package +### Install the Package Install the package via [NuGet](https://www.nuget.org/): @@ -37,7 +37,7 @@ dotnet add package Azure.ResourceManager.PlanetaryComputer --prerelease --- -### ๐Ÿ› ๏ธ Prerequisites +### Prerequisites - [.NET SDK 8.0+](https://dotnet.microsoft.com/download) - [Azure SDK Test Proxy](https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md) @@ -57,9 +57,13 @@ $env:AZURE_AUTHORITY_HOST = "https://login.microsoftonline.com" $env:AZURE_IDENTITY_NAME = "" ``` +### Authenticate the Client +Not required + + --- -## โœ… Supported Tests +## Supported Tests | Test Name | Description | |----------------------------------|---------------------------------------------| @@ -73,9 +77,9 @@ $env:AZURE_IDENTITY_NAME = "" --- -## ๐Ÿงช Running Tests +## Running Tests -### โ–ถ๏ธ Record Mode (Live with Azure) +### Record Mode (Live with Azure) 1. Start the test proxy: ```bash @@ -96,7 +100,7 @@ $env:AZURE_IDENTITY_NAME = "" --- -### โฏ๏ธ Playback Mode (Offline Testing) +### Playback Mode (Offline Testing) 1. Set mode: ```bash diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json index ef91b34e7abd..7dd2ebe09b97 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json @@ -2,7 +2,7 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer", - "Tag": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer_04278b495e", + "Tag": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer_c9092f326f", "ServiceDirectory": "planetarycomputer", "SessionRecordsDirectory": "SessionRecords" } From 7a59c22f27eafe52bfc02df3b34d4f70a0350a39 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 08:54:11 -0700 Subject: [PATCH 22/43] fix recorded tests --- .../Azure.ResourceManager.PlanetaryComputer/README.md | 10 +++++----- .../assets.json | 2 +- .../tests/Scenario/GeoCatalogCollectionTests.cs | 8 +++++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 857cda376da9..63205cb6c79a 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -25,9 +25,9 @@ sdk/ --- -## Getting Started +## Getting Started -### Install the Package +### Install the Package Install the package via [NuGet](https://www.nuget.org/): @@ -37,7 +37,7 @@ dotnet add package Azure.ResourceManager.PlanetaryComputer --prerelease --- -### Prerequisites +### Prerequisites - [.NET SDK 8.0+](https://dotnet.microsoft.com/download) - [Azure SDK Test Proxy](https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md) @@ -63,7 +63,7 @@ Not required --- -## Supported Tests +## Supported Tests | Test Name | Description | |----------------------------------|---------------------------------------------| @@ -77,7 +77,7 @@ Not required --- -## Running Tests +## Running Tests ### Record Mode (Live with Azure) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json index 7dd2ebe09b97..db5f881ed922 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/assets.json @@ -2,7 +2,7 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer", - "Tag": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer_c9092f326f", + "Tag": "net/planetarycomputer/Azure.ResourceManager.PlanetaryComputer_d1a808570c", "ServiceDirectory": "planetarycomputer", "SessionRecordsDirectory": "SessionRecords" } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs index 90251d77fd4b..caf83929f7d8 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs @@ -18,9 +18,11 @@ namespace Azure.ResourceManager.PlanetaryComputer.Tests [TestFixture(true)] public class GeoCatalogCollectionTests : PlanetaryComputerManagementTestBase { - // Add an existing GeoCatalog + // Add ExistingGeoCatalogName if you have a catalog to test against. This is for testing the GetGeoCatalog method. private const string ExistingGeoCatalogName = ""; - private const string ResourceGroupName = "shakrao-test"; + // Set the ResourceGroupName and Region to match your Azure environment. + // Ensure the resource group exists in your subscription. + private const string ResourceGroupName = "test"; private const string Region = "uksouth"; public GeoCatalogCollectionTests(bool isAsync) @@ -76,7 +78,7 @@ public async Task CreateGeoCatalog() { UserAssignedIdentities = { - [new ResourceIdentifier($"/subscriptions/ac9a1867-7476-4346-bf8b-968370fe212c/resourceGroups/msi-test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-uk-1")] = new UserAssignedIdentity() + [new ResourceIdentifier($"/subscriptions/{Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID")}/resourceGroups/shakrao-test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{Environment.GetEnvironmentVariable("AZURE_IDENTITY_NAME")}")] = new UserAssignedIdentity() } }, Properties = new GeoCatalogProperties From 9526fad75b8e3375ece23f2b65517bbcd607ff01 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 09:22:15 -0700 Subject: [PATCH 23/43] fix readme --- .../README.md | 71 +++++++++++++++++-- 1 file changed, 65 insertions(+), 6 deletions(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 63205cb6c79a..4e4e1263ccc7 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -6,7 +6,7 @@ It supports full **CRUD operations**, as well as **recorded** and **playback tes --- -## Project Structure +## Project Structure ``` sdk/ @@ -54,13 +54,8 @@ dotnet add package Azure.ResourceManager.PlanetaryComputer --prerelease $env:AZURE_SUBSCRIPTION_ID = "" $env:AZURE_TEST_MODE = "Record" # or "Playback" $env:AZURE_AUTHORITY_HOST = "https://login.microsoftonline.com" -$env:AZURE_IDENTITY_NAME = "" ``` -### Authenticate the Client -Not required - - --- ## Supported Tests @@ -114,3 +109,67 @@ Not required ```bash dotnet test -f net8.0 --filter "Name=CreateUpdateDeleteGeoCatalog" ``` + +--- + +## Authenticate the Client + +To authenticate the client, use the `DefaultAzureCredential` from the Azure.Identity library. Ensure your environment is set up with the necessary Azure credentials. + +```csharp +using Azure.Identity; +using Azure.ResourceManager.PlanetaryComputer; + +var credential = new DefaultAzureCredential(); +var client = new PlanetaryComputerManagementClient(credential); +``` + +## Key Concepts + +The PlanetaryComputer SDK provides management capabilities for GeoCatalog resources. Key concepts include: +- **GeoCatalog**: Represents a catalog of geospatial data. +- **CRUD Operations**: Create, Read, Update, and Delete operations for GeoCatalog resources. +- **Authentication**: Uses Azure Active Directory for secure access. + +## Examples + +### Create a GeoCatalog + +```csharp +var geoCatalogData = new GeoCatalogData(new AzureLocation("uksouth")) +{ + Properties = new GeoCatalogProperties + { + Tier = CatalogTier.Basic + } +}; + +var geoCatalog = await client.GeoCatalogs.CreateOrUpdateAsync("resourceGroupName", "geoCatalogName", geoCatalogData); +``` + +### List GeoCatalogs + +```csharp +var geoCatalogs = await client.GeoCatalogs.ListAsync("resourceGroupName"); +foreach (var catalog in geoCatalogs) +{ + Console.WriteLine(catalog.Name); +} +``` + +## Troubleshooting + +If you encounter issues, check the following: +- Ensure Azure CLI is logged in (`az login`). +- Verify the subscription and resource group names. +- Check for network connectivity issues. + +## Next Steps + +Explore additional features of the PlanetaryComputer SDK: +- [Azure SDK Documentation](https://learn.microsoft.com/en-us/azure/) +- [Samples Repository](https://github.com/Azure/azure-sdk-for-net) + +## Contributing + +We welcome contributions! Please see our [Contributing Guide](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for details on how to get started. From 459cde26ed5bcc8cd188b0638f42ebe643bfb213 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 09:43:41 -0700 Subject: [PATCH 24/43] fix readme 2 --- .../Azure.ResourceManager.PlanetaryComputer/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 4e4e1263ccc7..4cae0986a648 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -167,7 +167,6 @@ If you encounter issues, check the following: ## Next Steps Explore additional features of the PlanetaryComputer SDK: -- [Azure SDK Documentation](https://learn.microsoft.com/en-us/azure/) - [Samples Repository](https://github.com/Azure/azure-sdk-for-net) ## Contributing From 25615ccb5495a6847e45312286c56627fdaa4aa4 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 16:55:21 -0700 Subject: [PATCH 25/43] fix readme 3 --- .../Azure.ResourceManager.PlanetaryComputer/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 4cae0986a648..28f0fd63d008 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -1,4 +1,4 @@ -# Microsoft Azure PlanetaryComputer Management Client Library for .NET +## Azure PlanetaryComputer Management Client Library for .NET The `Azure.ResourceManager.PlanetaryComputer` SDK is the **.NET Management Plane SDK** for working with `GeoCatalog` resources under the **PlanetaryComputer** service. @@ -25,7 +25,7 @@ sdk/ --- -## Getting Started +## Getting started ### Install the Package @@ -124,7 +124,7 @@ var credential = new DefaultAzureCredential(); var client = new PlanetaryComputerManagementClient(credential); ``` -## Key Concepts +## Key concepts The PlanetaryComputer SDK provides management capabilities for GeoCatalog resources. Key concepts include: - **GeoCatalog**: Represents a catalog of geospatial data. @@ -164,9 +164,10 @@ If you encounter issues, check the following: - Verify the subscription and resource group names. - Check for network connectivity issues. -## Next Steps +## Next steps Explore additional features of the PlanetaryComputer SDK: +- [Azure SDK Documentation](https://learn.microsoft.com/en-us/azure/) - [Samples Repository](https://github.com/Azure/azure-sdk-for-net) ## Contributing From 79d46df553c69c746e4de6430a04fc709e5bb272 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 16:55:40 -0700 Subject: [PATCH 26/43] fix readme 4 --- .../tests/Scenario/GeoCatalogCollectionTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs index caf83929f7d8..f3695af637d6 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs @@ -22,7 +22,7 @@ public class GeoCatalogCollectionTests : PlanetaryComputerManagementTestBase private const string ExistingGeoCatalogName = ""; // Set the ResourceGroupName and Region to match your Azure environment. // Ensure the resource group exists in your subscription. - private const string ResourceGroupName = "test"; + private const string ResourceGroupName = "shakrao-test"; private const string Region = "uksouth"; public GeoCatalogCollectionTests(bool isAsync) From b0dd91478a05c87728b4e6947e2c9456a2e188e8 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 17:08:11 -0700 Subject: [PATCH 27/43] fix readme 5 --- .../Azure.ResourceManager.PlanetaryComputer/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 28f0fd63d008..7195682379d2 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -167,7 +167,6 @@ If you encounter issues, check the following: ## Next steps Explore additional features of the PlanetaryComputer SDK: -- [Azure SDK Documentation](https://learn.microsoft.com/en-us/azure/) - [Samples Repository](https://github.com/Azure/azure-sdk-for-net) ## Contributing From 941855ad062a9e029d27f5b2a47aaeb7c6218564 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 18:08:43 -0700 Subject: [PATCH 28/43] fix readme 6 --- .../README.md | 24 +++++++++---------- .../Scenario/GeoCatalogCollectionTests.cs | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index 7195682379d2..d31653a6fc65 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -55,9 +55,20 @@ $env:AZURE_SUBSCRIPTION_ID = "" $env:AZURE_TEST_MODE = "Record" # or "Playback" $env:AZURE_AUTHORITY_HOST = "https://login.microsoftonline.com" ``` - --- +### Authenticate the Client + +To authenticate the client, use the `DefaultAzureCredential` from the Azure.Identity library. Ensure your environment is set up with the necessary Azure credentials. + +```csharp +using Azure.Identity; +using Azure.ResourceManager.PlanetaryComputer; + +var credential = new DefaultAzureCredential(); +var client = new PlanetaryComputerManagementClient(credential); +``` + ## Supported Tests | Test Name | Description | @@ -112,17 +123,6 @@ $env:AZURE_AUTHORITY_HOST = "https://login.microsoftonline.com" --- -## Authenticate the Client - -To authenticate the client, use the `DefaultAzureCredential` from the Azure.Identity library. Ensure your environment is set up with the necessary Azure credentials. - -```csharp -using Azure.Identity; -using Azure.ResourceManager.PlanetaryComputer; - -var credential = new DefaultAzureCredential(); -var client = new PlanetaryComputerManagementClient(credential); -``` ## Key concepts diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs index f3695af637d6..fb6616c5158f 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs @@ -78,7 +78,7 @@ public async Task CreateGeoCatalog() { UserAssignedIdentities = { - [new ResourceIdentifier($"/subscriptions/{Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID")}/resourceGroups/shakrao-test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{Environment.GetEnvironmentVariable("AZURE_IDENTITY_NAME")}")] = new UserAssignedIdentity() + [new ResourceIdentifier($"/subscriptions/ac9a1867-7476-4346-bf8b-968370fe212c/resourceGroups/msi-test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-uk-1")] = new UserAssignedIdentity() } }, Properties = new GeoCatalogProperties From af000b515557f7e0108790e402f997f72e16f851 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 18:29:49 -0700 Subject: [PATCH 29/43] fix readme 7 --- .../Azure.ResourceManager.PlanetaryComputer/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index d31653a6fc65..e49b2b9c4c0f 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -1,4 +1,4 @@ -## Azure PlanetaryComputer Management Client Library for .NET +## Microsft Azure PlanetaryComputer client library for .NET The `Azure.ResourceManager.PlanetaryComputer` SDK is the **.NET Management Plane SDK** for working with `GeoCatalog` resources under the **PlanetaryComputer** service. From fa44ba89feb37e972bb5de395e4a930495a19981 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Wed, 25 Jun 2025 22:12:47 -0700 Subject: [PATCH 30/43] ignore spell check for the word spatio --- .vscode/cspell.json | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 470cebeef2cf..62370495fb4a 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -48,6 +48,7 @@ "sdk/machinelearningservices/*/api/*.cs", "sdk/modelsrepository/*/api/*.cs", "sdk/monitor/Azure.ResourceManager.Monitor/api/*.cs", + "sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/*.cs", "sdk/objectanchors/*/api/*.cs", "sdk/openai/Azure.AI.OpenAI/tests/Assets/playback_test_config.json", "sdk/purview/*/api/*.cs", @@ -159,6 +160,7 @@ "skus", "Somaxconn", "southcentralus", + "spatio", "structs", "Sybase", "Sysctls", @@ -428,14 +430,6 @@ "tibt" ] }, - { - "filename": "**/sdk/connectedcache/**/*", - "words": [ - "Gbps", - "Mbps", - "Eflow" - ] - }, { "filename": "**/sdk/connectedvmwarevsphere/**/*", "words": [ @@ -1133,7 +1127,6 @@ "dnsprivateviewocid", "Ords", "Ocid", - "Ocids", "ncharacter", "ocpu", "Iorm", @@ -1144,11 +1137,7 @@ "Tcps", "Ezconnect", "Ezconnectplus", - "Oltp", - "exadb", - "Exadb", - "Exascale", - "exascale" + "Oltp" ] }, { From a9bb61b2d594ea891a45a650066d3c34768b2b2b Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Thu, 26 Jun 2025 08:51:11 -0700 Subject: [PATCH 31/43] change tsp location config --- .../Extensions/PlanetaryComputerExtensions.cs | 2 +- .../src/Generated/GeoCatalogCollection.cs | 5 - .../Generated/GeoCatalogData.Serialization.cs | 2 +- .../src/Generated/GeoCatalogData.cs | 2 +- .../GeoCatalogResource.Serialization.cs | 11 +- .../src/Generated/GeoCatalogResource.cs | 2 +- .../Internal/ModelSerializationExtensions.cs | 26 +++ .../GeoCatalogOperationSource.cs | 4 +- .../PlanetaryComputerArmOperation.cs | 2 +- .../PlanetaryComputerArmOperationOfT.cs | 2 +- ...ResourceManagerPlanetaryComputerContext.cs | 19 ++ .../GeoCatalogListResult.Serialization.cs | 2 +- .../Models/GeoCatalogPatch.Serialization.cs | 2 +- .../src/Generated/Models/GeoCatalogPatch.cs | 6 +- .../GeoCatalogProperties.Serialization.cs | 2 +- .../Generated/Models/GeoCatalogProperties.cs | 2 +- ...agedServiceIdentityUpdate.Serialization.cs | 2 +- .../Samples/Sample_GeoCatalogCollection.cs | 212 ++++++++++++++++++ .../Samples/Sample_GeoCatalogResource.cs | 122 ++++++++++ .../Sample_SubscriptionResourceExtensions.cs | 50 +++++ .../tsp-location.yaml | 4 +- 21 files changed, 454 insertions(+), 27 deletions(-) create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/AzureResourceManagerPlanetaryComputerContext.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_GeoCatalogCollection.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_GeoCatalogResource.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs index c95ac251b794..d3ce6d23f989 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs @@ -9,8 +9,8 @@ using System.Threading; using System.Threading.Tasks; using Azure.Core; -using Azure.ResourceManager.Resources; using Azure.ResourceManager.PlanetaryComputer.Mocking; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.PlanetaryComputer { diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogCollection.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogCollection.cs index e4e0c9b75739..fd8b83938ea8 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogCollection.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogCollection.cs @@ -1,8 +1,3 @@ - - - - - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.Serialization.cs index d59e0a915a98..4eb3a14dcc42 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.Serialization.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.Serialization.cs @@ -169,7 +169,7 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions opti switch (format) { case "J": - return ModelReaderWriter.Write(this, options); + return ModelReaderWriter.Write(this, options, AzureResourceManagerPlanetaryComputerContext.Default); default: throw new FormatException($"The model {nameof(GeoCatalogData)} does not support writing '{options.Format}' format."); } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.cs index 5360bb55ddd9..37433b9f6e04 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.PlanetaryComputer { /// /// A class representing the GeoCatalog data model. - /// A MPC Pro catalog resource + /// A Microsoft Planetary Computer Pro GeoCatalog resource /// public partial class GeoCatalogData : TrackedResourceData { diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs index 9676d94f8089..7bb0af583776 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs @@ -13,14 +13,17 @@ namespace Azure.ResourceManager.PlanetaryComputer { public partial class GeoCatalogResource : IJsonModel { + private static GeoCatalogData s_dataDeserializationInstance; + private static GeoCatalogData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - GeoCatalogData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + GeoCatalogData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerPlanetaryComputerContext.Default); - GeoCatalogData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + GeoCatalogData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerPlanetaryComputerContext.Default); - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.cs index 06508dcea103..d7949132e004 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.cs @@ -12,8 +12,8 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; using Azure.ResourceManager.PlanetaryComputer.Models; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.PlanetaryComputer { diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ModelSerializationExtensions.cs index 55cbebcc8aec..78f9b4780f26 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ModelSerializationExtensions.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Internal/ModelSerializationExtensions.cs @@ -9,10 +9,12 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Text.Json; using System.Xml; using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.PlanetaryComputer { @@ -20,6 +22,9 @@ internal static class ModelSerializationExtensions { internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray()); + internal static readonly JsonSerializerOptions Options = new JsonSerializerOptions { Converters = { new JsonModelConverter(WireOptions, AzureResourceManagerPlanetaryComputerContext.Default) } }; + internal static readonly JsonSerializerOptions OptionsUseManagedServiceIdentityV3 = new JsonSerializerOptions { Converters = { new JsonModelConverter(WireOptions, AzureResourceManagerPlanetaryComputerContext.Default), new ResourceManager.Models.ManagedServiceIdentityTypeV3Converter() } }; public static object GetObject(this JsonElement element) { @@ -257,6 +262,27 @@ public static void WriteObjectValue(this Utf8JsonWriter writer, object value, Mo writer.WriteObjectValue(value, options); } + internal static bool IsSentinelValue(BinaryData value) + { + ReadOnlySpan sentinelSpan = SentinelValue.ToMemory().Span; + ReadOnlySpan valueSpan = value.ToMemory().Span; + return sentinelSpan.SequenceEqual(valueSpan); + } + + [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "By passing in the JsonSerializerOptions with a reference to AzureResourceManagerCosmosDBContext.Default we are certain there is no AOT compat issue.")] + [UnconditionalSuppressMessage("Trimming", "IL3050", Justification = "By passing in the JsonSerializerOptions with a reference to AzureResourceManagerCosmosDBContext.Default we are certain there is no AOT compat issue.")] + public static T JsonDeserialize(string json, JsonSerializerOptions options) + { + return JsonSerializer.Deserialize(json, options); + } + + [UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "By passing in the JsonSerializerOptions with a reference to AzureResourceManagerCosmosDBContext.Default we are certain there is no AOT compat issue.")] + [UnconditionalSuppressMessage("Trimming", "IL3050", Justification = "By passing in the JsonSerializerOptions with a reference to AzureResourceManagerCosmosDBContext.Default we are certain there is no AOT compat issue.")] + public static void JsonSerialize(Utf8JsonWriter writer, T data, JsonSerializerOptions options) + { + JsonSerializer.Serialize(writer, data, options); + } + internal static class TypeFormatters { private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs index 71a167a6551d..ec441dd6ca65 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs @@ -23,13 +23,13 @@ internal GeoCatalogOperationSource(ArmClient client) GeoCatalogResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) { - var data = ModelReaderWriter.Read(response.Content); + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPlanetaryComputerContext.Default); return new GeoCatalogResource(_client, data); } async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) { - var data = ModelReaderWriter.Read(response.Content); + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPlanetaryComputerContext.Default); return await Task.FromResult(new GeoCatalogResource(_client, data)).ConfigureAwait(false); } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperation.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperation.cs index 24e38640c289..1084060663db 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperation.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperation.cs @@ -58,7 +58,7 @@ private string GetOperationId(RehydrationToken? rehydrationToken) { return null; } - var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerPlanetaryComputerContext.Default).ToObjectFromJson>(); return lroDetails["id"]; } /// diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperationOfT.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperationOfT.cs index a01b9da93997..cf6b3a0f4020 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperationOfT.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerArmOperationOfT.cs @@ -58,7 +58,7 @@ private string GetOperationId(RehydrationToken? rehydrationToken) { return null; } - var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerPlanetaryComputerContext.Default).ToObjectFromJson>(); return lroDetails["id"]; } /// diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/AzureResourceManagerPlanetaryComputerContext.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/AzureResourceManagerPlanetaryComputerContext.cs new file mode 100644 index 000000000000..5a27d4a5a9b0 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/AzureResourceManagerPlanetaryComputerContext.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + /// + /// Context class which will be filled in by the System.ClientModel.SourceGeneration. + /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' + /// + public partial class AzureResourceManagerPlanetaryComputerContext : ModelReaderWriterContext + { + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs index 5e6be2bcb7da..602438cefb58 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs @@ -124,7 +124,7 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption switch (format) { case "J": - return ModelReaderWriter.Write(this, options); + return ModelReaderWriter.Write(this, options, AzureResourceManagerPlanetaryComputerContext.Default); default: throw new FormatException($"The model {nameof(GeoCatalogListResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.Serialization.cs index d368659d1c95..02ef631b3a18 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.Serialization.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.Serialization.cs @@ -132,7 +132,7 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions opt switch (format) { case "J": - return ModelReaderWriter.Write(this, options); + return ModelReaderWriter.Write(this, options, AzureResourceManagerPlanetaryComputerContext.Default); default: throw new FormatException($"The model {nameof(GeoCatalogPatch)} does not support writing '{options.Format}' format."); } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.cs index 789eb911cc8e..e5bd7eb7dc5a 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.PlanetaryComputer.Models { - /// Patch request workaround for Swagger LintDiff. Typespec Bug: https://github.com/Azure/typespec-azure/issues/383. + /// The properties of a GeoCatalog that can be updated. public partial class GeoCatalogPatch { /// @@ -53,7 +53,7 @@ public GeoCatalogPatch() /// Initializes a new instance of . /// Resource tags. - /// Updatable managed service identity. + /// The managed service identity properties to update. /// Keeps track of any properties unknown to the library. internal GeoCatalogPatch(IDictionary tags, ManagedServiceIdentityUpdate identity, IDictionary serializedAdditionalRawData) { @@ -64,7 +64,7 @@ internal GeoCatalogPatch(IDictionary tags, ManagedServiceIdentit /// Resource tags. public IDictionary Tags { get; } - /// Updatable managed service identity. + /// The managed service identity properties to update. public ManagedServiceIdentityUpdate Identity { get; set; } } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.Serialization.cs index ba5237f17430..d6cdbc388b95 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.Serialization.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.Serialization.cs @@ -147,7 +147,7 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption switch (format) { case "J": - return ModelReaderWriter.Write(this, options); + return ModelReaderWriter.Write(this, options, AzureResourceManagerPlanetaryComputerContext.Default); default: throw new FormatException($"The model {nameof(GeoCatalogProperties)} does not support writing '{options.Format}' format."); } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.cs index 35bbc74e5624..27b0c519c7fd 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.PlanetaryComputer.Models { - /// Details of the MPC Pro GeoCatalog. + /// The details of the Microsoft Planetary Computer Pro GeoCatalog. public partial class GeoCatalogProperties { /// diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs index ef1cda0bb846..f08503c8b2d9 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs @@ -133,7 +133,7 @@ BinaryData IPersistableModel.Write(ModelReaderWrit switch (format) { case "J": - return ModelReaderWriter.Write(this, options); + return ModelReaderWriter.Write(this, options, AzureResourceManagerPlanetaryComputerContext.Default); default: throw new FormatException($"The model {nameof(ManagedServiceIdentityUpdate)} does not support writing '{options.Format}' format."); } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_GeoCatalogCollection.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_GeoCatalogCollection.cs new file mode 100644 index 000000000000..9387103e7b6a --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_GeoCatalogCollection.cs @@ -0,0 +1,212 @@ +// 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.Models; +using Azure.ResourceManager.PlanetaryComputer.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.PlanetaryComputer.Samples +{ + public partial class Sample_GeoCatalogCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_GeoCatalogsCreate() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Create.json + // this example is just showing the usage of "GeoCatalog_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GeoCatalogResource + GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + + // invoke the operation + string catalogName = "MyCatalog"; + GeoCatalogData data = new GeoCatalogData(new AzureLocation("eastus")) + { + Properties = new GeoCatalogProperties + { + Tier = CatalogTier.Basic, + AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.NoReuse, + }, + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity")] = new UserAssignedIdentity() +}, + }, + Tags = +{ +["MyTag"] = "MyValue" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + GeoCatalogResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GeoCatalogsGet() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json + // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GeoCatalogResource + GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + + // invoke the operation + string catalogName = "MyCatalog"; + GeoCatalogResource result = await collection.GetAsync(catalogName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_GeoCatalogsListByResourceGroup() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_ListByResourceGroup.json + // this example is just showing the usage of "GeoCatalog_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GeoCatalogResource + GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + + // invoke the operation and iterate over the result + await foreach (GeoCatalogResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GeoCatalogsGet() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json + // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GeoCatalogResource + GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + + // invoke the operation + string catalogName = "MyCatalog"; + bool result = await collection.ExistsAsync(catalogName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GeoCatalogsGet() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json + // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; + string resourceGroupName = "MyResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GeoCatalogResource + GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + + // invoke the operation + string catalogName = "MyCatalog"; + NullableResponse response = await collection.GetIfExistsAsync(catalogName); + GeoCatalogResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_GeoCatalogResource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_GeoCatalogResource.cs new file mode 100644 index 000000000000..e65c70ee9e65 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_GeoCatalogResource.cs @@ -0,0 +1,122 @@ +// 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.Models; +using Azure.ResourceManager.PlanetaryComputer.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.PlanetaryComputer.Samples +{ + public partial class Sample_GeoCatalogResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GeoCatalogsGet() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json + // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this GeoCatalogResource created on azure + // for more information of creating GeoCatalogResource, please refer to the document of GeoCatalogResource + string subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; + string resourceGroupName = "MyResourceGroup"; + string catalogName = "MyCatalog"; + ResourceIdentifier geoCatalogResourceId = GeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); + GeoCatalogResource geoCatalog = client.GetGeoCatalogResource(geoCatalogResourceId); + + // invoke the operation + GeoCatalogResource result = await geoCatalog.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_GeoCatalogsDelete() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Delete.json + // this example is just showing the usage of "GeoCatalog_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this GeoCatalogResource created on azure + // for more information of creating GeoCatalogResource, please refer to the document of GeoCatalogResource + string subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; + string resourceGroupName = "MyResourceGroup"; + string catalogName = "MyCatalog"; + ResourceIdentifier geoCatalogResourceId = GeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); + GeoCatalogResource geoCatalog = client.GetGeoCatalogResource(geoCatalogResourceId); + + // invoke the operation + await geoCatalog.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_GeoCatalogsUpdate() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Update.json + // this example is just showing the usage of "GeoCatalog_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this GeoCatalogResource created on azure + // for more information of creating GeoCatalogResource, please refer to the document of GeoCatalogResource + string subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; + string resourceGroupName = "MyResourceGroup"; + string catalogName = "MyCatalog"; + ResourceIdentifier geoCatalogResourceId = GeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); + GeoCatalogResource geoCatalog = client.GetGeoCatalogResource(geoCatalogResourceId); + + // invoke the operation + GeoCatalogPatch patch = new GeoCatalogPatch + { + Tags = +{ +["MyTag"] = "MyValue" +}, + Identity = new ManagedServiceIdentityUpdate + { + Type = Models.ManagedServiceIdentityType.UserAssigned, + UserAssignedIdentities = +{ +["/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity"] = new UserAssignedIdentity() +}, + }, + }; + ArmOperation lro = await geoCatalog.UpdateAsync(WaitUntil.Completed, patch); + GeoCatalogResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..cf10b677a84b --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.PlanetaryComputer.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetGeoCatalogs_GeoCatalogsListBySubscription() + { + // Generated from example definition: 2025-02-11-preview/GeoCatalogs_ListBySubscription.json + // this example is just showing the usage of "GeoCatalog_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (GeoCatalogResource item in subscriptionResource.GetGeoCatalogsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + GeoCatalogData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml index b16d32804f4d..30ff609c8758 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml @@ -1,4 +1,4 @@ -directory: specification/spatio/PlanetaryComputerPro -commit: 0d7256e6981a80f797551fd87944458686e447fa +directory: specification/orbitalplanetarycomputer/Orbital.Management +commit: 558870b2064c76be7afdf0c744ffb502a92454c1 repo: Azure/azure-rest-api-specs additionalDirectories: From 050ae1f201111b2b2f00064923ee581fdf5f0f92 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Thu, 26 Jun 2025 09:37:35 -0700 Subject: [PATCH 32/43] Update API surface files after code generation --- .../api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs | 6 ++++++ ...zure.ResourceManager.PlanetaryComputer.netstandard2.0.cs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs index 155bf5e2eb3d..074e34d236cd 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs @@ -1,5 +1,11 @@ namespace Azure.ResourceManager.PlanetaryComputer { + public partial class AzureResourceManagerPlanetaryComputerContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerPlanetaryComputerContext() { } + public static Azure.ResourceManager.PlanetaryComputer.AzureResourceManagerPlanetaryComputerContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } public partial class GeoCatalogCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected GeoCatalogCollection() { } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs index 155bf5e2eb3d..074e34d236cd 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs @@ -1,5 +1,11 @@ namespace Azure.ResourceManager.PlanetaryComputer { + public partial class AzureResourceManagerPlanetaryComputerContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerPlanetaryComputerContext() { } + public static Azure.ResourceManager.PlanetaryComputer.AzureResourceManagerPlanetaryComputerContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } public partial class GeoCatalogCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected GeoCatalogCollection() { } From 3f086a6ae1bdf50512714844d138ea09785c652b Mon Sep 17 00:00:00 2001 From: Shakti Chetan Rao <55005052+shaktichetan23@users.noreply.github.com> Date: Thu, 26 Jun 2025 10:08:21 -0700 Subject: [PATCH 33/43] Update sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Azure.ResourceManager.PlanetaryComputer/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md index e49b2b9c4c0f..26910a00e95c 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md @@ -1,4 +1,4 @@ -## Microsft Azure PlanetaryComputer client library for .NET +## Microsoft Azure PlanetaryComputer client library for .NET The `Azure.ResourceManager.PlanetaryComputer` SDK is the **.NET Management Plane SDK** for working with `GeoCatalog` resources under the **PlanetaryComputer** service. From 0f2d5403433b38df8ef3dee3c3c57229a4753d75 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Thu, 26 Jun 2025 11:15:13 -0700 Subject: [PATCH 34/43] add codeowner --- .github/CODEOWNERS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 16de53c916db..9c936d6ede4d 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -771,6 +771,12 @@ # ServiceLabel: %Image Analysis # ServiceOwners: @rhurey @dargilco +# PRLabel: %Planetary Computer +/sdk/planetarycomputer/ @chahibi @shaktichetan23 + +# ServiceLabel: %Planetary Computer +# ServiceOwners: @chahibi @shaktichetan23 + # PRLabel: %Microsoft Playwright Testing /sdk/playwrighttesting/ @Sid200026 @puagarwa @ShreyaAnand From f8781b886a1320f9e194eab213951659ddc8a6ff Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Mon, 30 Jun 2025 13:48:54 -0700 Subject: [PATCH 35/43] add codeowners --- .github/CODEOWNERS | 5 ++--- .vscode/cspell.json | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9c936d6ede4d..4f3736e06603 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -772,10 +772,9 @@ # ServiceOwners: @rhurey @dargilco # PRLabel: %Planetary Computer -/sdk/planetarycomputer/ @chahibi @shaktichetan23 - +/sdk/planetarycomputer/ @chahibi @shaktichetan23 @thisisdevanshu @mandarinamdar # ServiceLabel: %Planetary Computer -# ServiceOwners: @chahibi @shaktichetan23 +# ServiceOwners: @chahibi @shaktichetan23 @thisisdevanshu @mandarinamdar # PRLabel: %Microsoft Playwright Testing /sdk/playwrighttesting/ @Sid200026 @puagarwa @ShreyaAnand diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 62370495fb4a..18251ae5195c 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -160,7 +160,6 @@ "skus", "Somaxconn", "southcentralus", - "spatio", "structs", "Sybase", "Sysctls", From 3888d8da993a9f8ea635a9015c9fda6a8257919a Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Tue, 1 Jul 2025 09:34:24 -0700 Subject: [PATCH 36/43] fix codeowners --- .github/CODEOWNERS | 4 ++-- .vscode/cspell.json | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4f3736e06603..7c7e452b05c2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -772,9 +772,9 @@ # ServiceOwners: @rhurey @dargilco # PRLabel: %Planetary Computer -/sdk/planetarycomputer/ @chahibi @shaktichetan23 @thisisdevanshu @mandarinamdar +/sdk/planetarycomputer/ @shaktichetan23 @thisisdevanshu # ServiceLabel: %Planetary Computer -# ServiceOwners: @chahibi @shaktichetan23 @thisisdevanshu @mandarinamdar +# ServiceOwners: @shaktichetan23 @thisisdevanshu # PRLabel: %Microsoft Playwright Testing /sdk/playwrighttesting/ @Sid200026 @puagarwa @ShreyaAnand diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 18251ae5195c..470cebeef2cf 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -48,7 +48,6 @@ "sdk/machinelearningservices/*/api/*.cs", "sdk/modelsrepository/*/api/*.cs", "sdk/monitor/Azure.ResourceManager.Monitor/api/*.cs", - "sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/*.cs", "sdk/objectanchors/*/api/*.cs", "sdk/openai/Azure.AI.OpenAI/tests/Assets/playback_test_config.json", "sdk/purview/*/api/*.cs", @@ -429,6 +428,14 @@ "tibt" ] }, + { + "filename": "**/sdk/connectedcache/**/*", + "words": [ + "Gbps", + "Mbps", + "Eflow" + ] + }, { "filename": "**/sdk/connectedvmwarevsphere/**/*", "words": [ @@ -1126,6 +1133,7 @@ "dnsprivateviewocid", "Ords", "Ocid", + "Ocids", "ncharacter", "ocpu", "Iorm", @@ -1136,7 +1144,11 @@ "Tcps", "Ezconnect", "Ezconnectplus", - "Oltp" + "Oltp", + "exadb", + "Exadb", + "Exascale", + "exascale" ] }, { From 3f9ef4c78dade607143ed8783a125a1d93f88fe5 Mon Sep 17 00:00:00 2001 From: shaktichetan23 Date: Tue, 1 Jul 2025 10:36:57 -0700 Subject: [PATCH 37/43] fix codeowners --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7c7e452b05c2..e18805ea6655 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -773,6 +773,7 @@ # PRLabel: %Planetary Computer /sdk/planetarycomputer/ @shaktichetan23 @thisisdevanshu + # ServiceLabel: %Planetary Computer # ServiceOwners: @shaktichetan23 @thisisdevanshu From dbc9f00c9b61fafab269be6e5571166c0c6a7db2 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Mon, 7 Jul 2025 17:49:28 +0800 Subject: [PATCH 38/43] update --- ...zure.ResourceManager.PlanetaryComputer.sln | 30 +-- .../CHANGELOG.md | 12 +- ...ceManager.PlanetaryComputer.Samples.csproj | 13 -- .../Generated/Samples/GeneratedSamples.csproj | 21 -- .../Samples/Sample_GeoCatalogCollection.cs | 212 ------------------ .../Samples/Sample_GeoCatalogResource.cs | 122 ---------- .../Sample_SubscriptionResourceExtensions.cs | 50 ----- sdk/planetarycomputer/ci.mgmt.yml | 13 +- 8 files changed, 14 insertions(+), 459 deletions(-) delete mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Azure.ResourceManager.PlanetaryComputer.Samples.csproj delete mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/GeneratedSamples.csproj delete mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogCollection.cs delete mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogResource.cs delete mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer.sln b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer.sln index 9e3d18da7378..d27e9fe484c6 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer.sln +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer.sln @@ -1,9 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29709.97 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36203.30 d17.14 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.PlanetaryComputer.Samples", "samples\Azure.ResourceManager.PlanetaryComputer.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.PlanetaryComputer", "src\Azure.ResourceManager.PlanetaryComputer.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.PlanetaryComputer.Tests", "tests\Azure.ResourceManager.PlanetaryComputer.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" @@ -14,30 +12,6 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU - {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.Build.0 = Release|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md index 8b33f0fedccc..a97f1297b3fb 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md @@ -4,8 +4,14 @@ ### Features Added -### Breaking Changes +This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: -### Bugs Fixed + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. -### Other Changes \ No newline at end of file +This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). + +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Azure.ResourceManager.PlanetaryComputer.Samples.csproj b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Azure.ResourceManager.PlanetaryComputer.Samples.csproj deleted file mode 100644 index 9afe1f52866d..000000000000 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Azure.ResourceManager.PlanetaryComputer.Samples.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/GeneratedSamples.csproj b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/GeneratedSamples.csproj deleted file mode 100644 index 7ee7af72add3..000000000000 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/GeneratedSamples.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - Exe - net8.0 - enable - enable - - - - - - - - - - - - - - diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogCollection.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogCollection.cs deleted file mode 100644 index cdc6996c9ae2..000000000000 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogCollection.cs +++ /dev/null @@ -1,212 +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.Models; -using Azure.ResourceManager.Resources; -using Azure.ResourceManager.PlanetaryComputer.Models; -using NUnit.Framework; - -namespace Azure.ResourceManager.PlanetaryComputer.Samples -{ - public partial class Sample_GeoCatalogCollection - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_GeoCatalogsCreate() - { - // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Create.json - // this example is just showing the usage of "GeoCatalog_Create" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; - string resourceGroupName = "MyResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this GeoCatalogResource - GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); - - // invoke the operation - string catalogName = "MyCatalog"; - GeoCatalogData data = new GeoCatalogData(new AzureLocation("eastus")) - { - Properties = new GeoCatalogProperties - { - Tier = CatalogTier.Basic, - AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.NoReuse, - }, - Identity = new ManagedServiceIdentity("UserAssigned") - { - UserAssignedIdentities = -{ -[new ResourceIdentifier("/subscriptions/ac9a1867-7476-4346-bf8b-968370fe212c/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity")] = new UserAssignedIdentity() -}, - }, - Tags = -{ -["MyTag"] = "MyValue" -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); - GeoCatalogResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GeoCatalogData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_GeoCatalogsGet() - { - // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json - // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; - string resourceGroupName = "MyResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this GeoCatalogResource - GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); - - // invoke the operation - string catalogName = "MyCatalog"; - GeoCatalogResource result = await collection.GetAsync(catalogName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GeoCatalogData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetAll_GeoCatalogsListByResourceGroup() - { - // Generated from example definition: 2025-02-11-preview/GeoCatalogs_ListByResourceGroup.json - // this example is just showing the usage of "GeoCatalog_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; - string resourceGroupName = "MyResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this GeoCatalogResource - GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); - - // invoke the operation and iterate over the result - await foreach (GeoCatalogResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GeoCatalogData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Exists_GeoCatalogsGet() - { - // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json - // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; - string resourceGroupName = "MyResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this GeoCatalogResource - GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); - - // invoke the operation - string catalogName = "MyCatalog"; - bool result = await collection.ExistsAsync(catalogName); - - Console.WriteLine($"Succeeded: {result}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetIfExists_GeoCatalogsGet() - { - // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json - // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; - string resourceGroupName = "MyResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this GeoCatalogResource - GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); - - // invoke the operation - string catalogName = "MyCatalog"; - NullableResponse response = await collection.GetIfExistsAsync(catalogName); - GeoCatalogResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine("Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GeoCatalogData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogResource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogResource.cs deleted file mode 100644 index 34ace5aac654..000000000000 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_GeoCatalogResource.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.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.PlanetaryComputer.Models; -using NUnit.Framework; - -namespace Azure.ResourceManager.PlanetaryComputer.Samples -{ - public partial class Sample_GeoCatalogResource - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_GeoCatalogsGet() - { - // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Get.json - // this example is just showing the usage of "GeoCatalog_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this GeoCatalogResource created on azure - // for more information of creating GeoCatalogResource, please refer to the document of GeoCatalogResource - string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; - string resourceGroupName = "MyResourceGroup"; - string catalogName = "MyCatalog"; - ResourceIdentifier geoCatalogResourceId = GeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); - GeoCatalogResource geoCatalog = client.GetGeoCatalogResource(geoCatalogResourceId); - - // invoke the operation - GeoCatalogResource result = await geoCatalog.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GeoCatalogData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Delete_GeoCatalogsDelete() - { - // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Delete.json - // this example is just showing the usage of "GeoCatalog_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this GeoCatalogResource created on azure - // for more information of creating GeoCatalogResource, please refer to the document of GeoCatalogResource - string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; - string resourceGroupName = "MyResourceGroup"; - string catalogName = "MyCatalog"; - ResourceIdentifier geoCatalogResourceId = GeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); - GeoCatalogResource geoCatalog = client.GetGeoCatalogResource(geoCatalogResourceId); - - // invoke the operation - await geoCatalog.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Update_GeoCatalogsUpdate() - { - // Generated from example definition: 2025-02-11-preview/GeoCatalogs_Update.json - // this example is just showing the usage of "GeoCatalog_Update" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this GeoCatalogResource created on azure - // for more information of creating GeoCatalogResource, please refer to the document of GeoCatalogResource - string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; - string resourceGroupName = "MyResourceGroup"; - string catalogName = "MyCatalog"; - ResourceIdentifier geoCatalogResourceId = GeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); - GeoCatalogResource geoCatalog = client.GetGeoCatalogResource(geoCatalogResourceId); - - // invoke the operation - GeoCatalogPatch patch = new GeoCatalogPatch - { - Tags = -{ -["MyTag"] = "MyValue" -}, - Identity = new ManagedServiceIdentityUpdate - { - Type = Models.ManagedServiceIdentityType.UserAssigned, - UserAssignedIdentities = -{ -["/subscriptions/ac9a1867-7476-4346-bf8b-968370fe212c/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity"] = new UserAssignedIdentity() -}, - }, - }; - ArmOperation lro = await geoCatalog.UpdateAsync(WaitUntil.Completed, patch); - GeoCatalogResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GeoCatalogData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs deleted file mode 100644 index f60adfb6971d..000000000000 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.Resources; -using NUnit.Framework; - -namespace Azure.ResourceManager.PlanetaryComputer.Samples -{ - public partial class Sample_SubscriptionResourceExtensions - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetGeoCatalogs_GeoCatalogsListBySubscription() - { - // Generated from example definition: 2025-02-11-preview/GeoCatalogs_ListBySubscription.json - // this example is just showing the usage of "GeoCatalog_ListBySubscription" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "ac9a1867-7476-4346-bf8b-968370fe212c"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation and iterate over the result - await foreach (GeoCatalogResource item in subscriptionResource.GetGeoCatalogsAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - GeoCatalogData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); - } - } -} diff --git a/sdk/planetarycomputer/ci.mgmt.yml b/sdk/planetarycomputer/ci.mgmt.yml index 93b8b6149a83..f5a937558dac 100644 --- a/sdk/planetarycomputer/ci.mgmt.yml +++ b/sdk/planetarycomputer/ci.mgmt.yml @@ -10,20 +10,13 @@ pr: - release/* paths: include: - - sdk/PlanetaryComputer/ci.mgmt.yml - - sdk/PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer/ - -/ci.mgmt.yml - - sdk/PlanetaryComputer -/Azure.ResourceManager.PlanetaryComputer -/ - + - sdk/planetarycomputer/ci.mgmt.yml + - sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/ extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: - ServiceDirectory: PlanetaryComputer - ArtifactName: packages + ServiceDirectory: planetarycomputer LimitForPullRequest: true Artifacts: - name: Azure.ResourceManager.PlanetaryComputer From ae47710bdbe156395cba96d6052e8e18e5a65239 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Mon, 7 Jul 2025 17:52:39 +0800 Subject: [PATCH 39/43] update --- .github/CODEOWNERS | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d0ffcb5c1e54..f7f88437bdbc 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -756,12 +756,6 @@ # ServiceLabel: %Image Analysis # ServiceOwners: @rhurey @dargilco -# PRLabel: %Planetary Computer -/sdk/planetarycomputer/ @shaktichetan23 @thisisdevanshu - -# ServiceLabel: %Planetary Computer -# ServiceOwners: @shaktichetan23 @thisisdevanshu - # PRLabel: %Microsoft Playwright Testing /sdk/playwrighttesting/ @Sid200026 @puagarwa @ShreyaAnand @@ -1106,6 +1100,12 @@ # ServiceLabel: %Pinecone %Mgmt # ServiceOwners: @aggarwalsw +# PRLabel: %Planetary Computer +/sdk/planetarycomputer/Azure.ResourceManager.*/ @shaktichetan23 @thisisdevanshu + +# ServiceLabel: %Planetary Computer %Mgmt +# ServiceOwners: @shaktichetan23 @thisisdevanshu + # PRLabel: %PureStorage /sdk/purestorageblock/Azure.ResourceManager.*/ @deepakmauryams From 1a3830c645cfec07a8ab403b4dddfde82d532f8a Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Mon, 7 Jul 2025 18:21:40 +0800 Subject: [PATCH 40/43] Update --- ...esourceManager.PlanetaryComputer.net8.0.cs | 218 ++++++++---------- ...anager.PlanetaryComputer.netstandard2.0.cs | 218 ++++++++---------- .../ArmPlanetaryComputerModelFactory.cs | 16 +- .../MockablePlanetaryComputerArmClient.cs | 12 +- ...ePlanetaryComputerResourceGroupResource.cs | 20 +- ...lePlanetaryComputerSubscriptionResource.cs | 32 +-- .../Extensions/PlanetaryComputerExtensions.cs | 58 ++--- .../GeoCatalogResource.Serialization.cs | 29 --- .../GeoCatalogOperationSource.cs | 36 --- ...netaryComputerGeoCatalogOperationSource.cs | 36 +++ .../src/Generated/Models/CatalogTier.cs | 48 ---- .../GeoCatalogListResult.Serialization.cs | 6 +- .../Generated/Models/GeoCatalogListResult.cs | 6 +- .../Models/ManagedServiceIdentityType.cs | 57 ----- ...agedServiceIdentityUpdate.Serialization.cs | 160 ------------- .../Models/ManagedServiceIdentityUpdate.cs | 71 ------ ...yComputerGeoCatalogPatch.Serialization.cs} | 47 ++-- ...cs => PlanetaryComputerGeoCatalogPatch.cs} | 13 +- ...uterGeoCatalogProperties.Serialization.cs} | 56 ++--- ... PlanetaryComputerGeoCatalogProperties.cs} | 16 +- .../Models/PlanetaryComputerGeoCatalogTier.cs | 48 ++++ .../PlanetaryComputerProvisioningState.cs | 66 ++++++ .../src/Generated/Models/ProvisioningState.cs | 66 ------ ... PlanetaryComputerGeoCatalogCollection.cs} | 130 +++++------ ...ryComputerGeoCatalogData.Serialization.cs} | 42 ++-- ....cs => PlanetaryComputerGeoCatalogData.cs} | 18 +- ...omputerGeoCatalogResource.Serialization.cs | 29 +++ ...=> PlanetaryComputerGeoCatalogResource.cs} | 166 ++++++------- .../GeoCatalogsRestOperations.cs | 32 +-- .../src/Properties/AssemblyInfo.cs | 2 +- ..._PlanetaryComputerGeoCatalogCollection.cs} | 48 ++-- ...le_PlanetaryComputerGeoCatalogResource.cs} | 45 ++-- .../Sample_SubscriptionResourceExtensions.cs | 6 +- .../Scenario/GeoCatalogCollectionTests.cs | 74 +++--- 34 files changed, 791 insertions(+), 1136 deletions(-) delete mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs delete mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerGeoCatalogOperationSource.cs delete mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/CatalogTier.cs delete mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityType.cs delete mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs delete mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.cs rename sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/{GeoCatalogPatch.Serialization.cs => PlanetaryComputerGeoCatalogPatch.Serialization.cs} (62%) rename sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/{GeoCatalogPatch.cs => PlanetaryComputerGeoCatalogPatch.cs} (79%) rename sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/{GeoCatalogProperties.Serialization.cs => PlanetaryComputerGeoCatalogProperties.Serialization.cs} (63%) rename sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/{GeoCatalogProperties.cs => PlanetaryComputerGeoCatalogProperties.cs} (79%) create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogTier.cs create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerProvisioningState.cs delete mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ProvisioningState.cs rename sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/{GeoCatalogCollection.cs => PlanetaryComputerGeoCatalogCollection.cs} (64%) rename sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/{GeoCatalogData.Serialization.cs => PlanetaryComputerGeoCatalogData.Serialization.cs} (73%) rename sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/{GeoCatalogData.cs => PlanetaryComputerGeoCatalogData.cs} (72%) create mode 100644 sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogResource.Serialization.cs rename sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/{GeoCatalogResource.cs => PlanetaryComputerGeoCatalogResource.cs} (70%) rename sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/{Sample_GeoCatalogCollection.cs => Sample_PlanetaryComputerGeoCatalogCollection.cs} (81%) rename sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/{Sample_GeoCatalogResource.cs => Sample_PlanetaryComputerGeoCatalogResource.cs} (59%) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs index 074e34d236cd..49316c270f17 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.net8.0.cs @@ -6,68 +6,68 @@ internal AzureResourceManagerPlanetaryComputerContext() { } public static Azure.ResourceManager.PlanetaryComputer.AzureResourceManagerPlanetaryComputerContext Default { get { throw null; } } protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } } - public partial class GeoCatalogCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + public static partial class PlanetaryComputerExtensions + { + public static Azure.Response GetPlanetaryComputerGeoCatalog(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetPlanetaryComputerGeoCatalogAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogResource GetPlanetaryComputerGeoCatalogResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogCollection GetPlanetaryComputerGeoCatalogs(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetPlanetaryComputerGeoCatalogs(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetPlanetaryComputerGeoCatalogsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class PlanetaryComputerGeoCatalogCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { - protected GeoCatalogCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.GeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.GeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + protected PlanetaryComputerGeoCatalogCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + public virtual Azure.Response Get(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class GeoCatalogData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class PlanetaryComputerGeoCatalogData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public GeoCatalogData(Azure.Core.AzureLocation location) { } + public PlanetaryComputerGeoCatalogData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } - public Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties Properties { get { throw null; } set { } } + public Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class GeoCatalogResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class PlanetaryComputerGeoCatalogResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; - protected GeoCatalogResource() { } - public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogData Data { get { throw null; } } + protected PlanetaryComputerGeoCatalogResource() { } + public virtual Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string catalogName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public static partial class PlanetaryComputerExtensions - { - public static Azure.Response GetGeoCatalog(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetGeoCatalogAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogResource GetGeoCatalogResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogCollection GetGeoCatalogs(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } - public static Azure.Pageable GetGeoCatalogs(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetGeoCatalogsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.PlanetaryComputer.Mocking @@ -75,28 +75,28 @@ namespace Azure.ResourceManager.PlanetaryComputer.Mocking public partial class MockablePlanetaryComputerArmClient : Azure.ResourceManager.ArmResource { protected MockablePlanetaryComputerArmClient() { } - public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogResource GetGeoCatalogResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogResource GetPlanetaryComputerGeoCatalogResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockablePlanetaryComputerResourceGroupResource : Azure.ResourceManager.ArmResource { protected MockablePlanetaryComputerResourceGroupResource() { } - public virtual Azure.Response GetGeoCatalog(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetGeoCatalogAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogCollection GetGeoCatalogs() { throw null; } + public virtual Azure.Response GetPlanetaryComputerGeoCatalog(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPlanetaryComputerGeoCatalogAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogCollection GetPlanetaryComputerGeoCatalogs() { throw null; } } public partial class MockablePlanetaryComputerSubscriptionResource : Azure.ResourceManager.ArmResource { protected MockablePlanetaryComputerSubscriptionResource() { } - public virtual Azure.Pageable GetGeoCatalogs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetGeoCatalogsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetPlanetaryComputerGeoCatalogs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetPlanetaryComputerGeoCatalogsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.PlanetaryComputer.Models { public static partial class ArmPlanetaryComputerModelFactory { - public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogData GeoCatalogData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } - public static Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties GeoCatalogProperties(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier? tier = default(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier?), string catalogUri = null, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState?), Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope?)) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData PlanetaryComputerGeoCatalogData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogProperties PlanetaryComputerGeoCatalogProperties(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier? tier = default(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier?), System.Uri catalogUri = null, Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState? provisioningState = default(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState?), Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope?)) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct AutoGeneratedDomainNameLabelScope : System.IEquatable @@ -118,102 +118,70 @@ public static partial class ArmPlanetaryComputerModelFactory public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct CatalogTier : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public CatalogTier(string value) { throw null; } - public static Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier Basic { get { throw null; } } - public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier right) { throw null; } - public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier right) { throw null; } - public override string ToString() { throw null; } - } - public partial class GeoCatalogPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class PlanetaryComputerGeoCatalogPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public GeoCatalogPatch() { } - public Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate Identity { get { throw null; } set { } } + public PlanetaryComputerGeoCatalogPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class GeoCatalogProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class PlanetaryComputerGeoCatalogProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public GeoCatalogProperties() { } + public PlanetaryComputerGeoCatalogProperties() { } public Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } - public string CatalogUri { get { throw null; } } - public Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState? ProvisioningState { get { throw null; } } - public Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier? Tier { get { throw null; } set { } } + public System.Uri CatalogUri { get { throw null; } } + public Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier? Tier { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ManagedServiceIdentityType : System.IEquatable + public readonly partial struct PlanetaryComputerGeoCatalogTier : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public ManagedServiceIdentityType(string value) { throw null; } - public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType None { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType SystemAssigned { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType SystemAssignedUserAssigned { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType UserAssigned { get { throw null; } } - public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType other) { throw null; } + public PlanetaryComputerGeoCatalogTier(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier Basic { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType left, Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType right) { throw null; } - public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType left, Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType right) { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier right) { throw null; } public override string ToString() { throw null; } } - public partial class ManagedServiceIdentityUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public ManagedServiceIdentityUpdate() { } - public Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType? Type { get { throw null; } set { } } - public System.Collections.Generic.IDictionary UserAssignedIdentities { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ProvisioningState : System.IEquatable + public readonly partial struct PlanetaryComputerProvisioningState : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public ProvisioningState(string value) { throw null; } - public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Accepted { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Canceled { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Deleting { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Failed { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Provisioning { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Succeeded { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Updating { get { throw null; } } - public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState other) { throw null; } + public PlanetaryComputerProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState right) { throw null; } - public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState right) { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState right) { throw null; } public override string ToString() { throw null; } } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs index 074e34d236cd..49316c270f17 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/api/Azure.ResourceManager.PlanetaryComputer.netstandard2.0.cs @@ -6,68 +6,68 @@ internal AzureResourceManagerPlanetaryComputerContext() { } public static Azure.ResourceManager.PlanetaryComputer.AzureResourceManagerPlanetaryComputerContext Default { get { throw null; } } protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } } - public partial class GeoCatalogCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + public static partial class PlanetaryComputerExtensions + { + public static Azure.Response GetPlanetaryComputerGeoCatalog(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetPlanetaryComputerGeoCatalogAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogResource GetPlanetaryComputerGeoCatalogResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogCollection GetPlanetaryComputerGeoCatalogs(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetPlanetaryComputerGeoCatalogs(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetPlanetaryComputerGeoCatalogsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class PlanetaryComputerGeoCatalogCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { - protected GeoCatalogCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.GeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.GeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + protected PlanetaryComputerGeoCatalogCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string catalogName, Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + public virtual Azure.Response Get(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class GeoCatalogData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class PlanetaryComputerGeoCatalogData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public GeoCatalogData(Azure.Core.AzureLocation location) { } + public PlanetaryComputerGeoCatalogData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } - public Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties Properties { get { throw null; } set { } } + public Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogProperties Properties { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class GeoCatalogResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class PlanetaryComputerGeoCatalogResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; - protected GeoCatalogResource() { } - public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogData Data { get { throw null; } } + protected PlanetaryComputerGeoCatalogResource() { } + public virtual Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string catalogName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.GeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public static partial class PlanetaryComputerExtensions - { - public static Azure.Response GetGeoCatalog(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetGeoCatalogAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogResource GetGeoCatalogResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogCollection GetGeoCatalogs(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } - public static Azure.Pageable GetGeoCatalogs(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetGeoCatalogsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.PlanetaryComputer.Mocking @@ -75,28 +75,28 @@ namespace Azure.ResourceManager.PlanetaryComputer.Mocking public partial class MockablePlanetaryComputerArmClient : Azure.ResourceManager.ArmResource { protected MockablePlanetaryComputerArmClient() { } - public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogResource GetGeoCatalogResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogResource GetPlanetaryComputerGeoCatalogResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockablePlanetaryComputerResourceGroupResource : Azure.ResourceManager.ArmResource { protected MockablePlanetaryComputerResourceGroupResource() { } - public virtual Azure.Response GetGeoCatalog(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetGeoCatalogAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.PlanetaryComputer.GeoCatalogCollection GetGeoCatalogs() { throw null; } + public virtual Azure.Response GetPlanetaryComputerGeoCatalog(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPlanetaryComputerGeoCatalogAsync(string catalogName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogCollection GetPlanetaryComputerGeoCatalogs() { throw null; } } public partial class MockablePlanetaryComputerSubscriptionResource : Azure.ResourceManager.ArmResource { protected MockablePlanetaryComputerSubscriptionResource() { } - public virtual Azure.Pageable GetGeoCatalogs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetGeoCatalogsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetPlanetaryComputerGeoCatalogs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetPlanetaryComputerGeoCatalogsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.PlanetaryComputer.Models { public static partial class ArmPlanetaryComputerModelFactory { - public static Azure.ResourceManager.PlanetaryComputer.GeoCatalogData GeoCatalogData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } - public static Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties GeoCatalogProperties(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier? tier = default(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier?), string catalogUri = null, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState?), Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope?)) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.PlanetaryComputerGeoCatalogData PlanetaryComputerGeoCatalogData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogProperties PlanetaryComputerGeoCatalogProperties(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier? tier = default(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier?), System.Uri catalogUri = null, Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState? provisioningState = default(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState?), Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope?)) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct AutoGeneratedDomainNameLabelScope : System.IEquatable @@ -118,102 +118,70 @@ public static partial class ArmPlanetaryComputerModelFactory public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct CatalogTier : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public CatalogTier(string value) { throw null; } - public static Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier Basic { get { throw null; } } - public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier right) { throw null; } - public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier right) { throw null; } - public override string ToString() { throw null; } - } - public partial class GeoCatalogPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class PlanetaryComputerGeoCatalogPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public GeoCatalogPatch() { } - public Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate Identity { get { throw null; } set { } } + public PlanetaryComputerGeoCatalogPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class GeoCatalogProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class PlanetaryComputerGeoCatalogProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public GeoCatalogProperties() { } + public PlanetaryComputerGeoCatalogProperties() { } public Azure.ResourceManager.PlanetaryComputer.Models.AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get { throw null; } set { } } - public string CatalogUri { get { throw null; } } - public Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState? ProvisioningState { get { throw null; } } - public Azure.ResourceManager.PlanetaryComputer.Models.CatalogTier? Tier { get { throw null; } set { } } + public System.Uri CatalogUri { get { throw null; } } + public Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier? Tier { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.Models.GeoCatalogProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ManagedServiceIdentityType : System.IEquatable + public readonly partial struct PlanetaryComputerGeoCatalogTier : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public ManagedServiceIdentityType(string value) { throw null; } - public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType None { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType SystemAssigned { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType SystemAssignedUserAssigned { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType UserAssigned { get { throw null; } } - public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType other) { throw null; } + public PlanetaryComputerGeoCatalogTier(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier Basic { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType left, Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType right) { throw null; } - public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType left, Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType right) { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier left, Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerGeoCatalogTier right) { throw null; } public override string ToString() { throw null; } } - public partial class ManagedServiceIdentityUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public ManagedServiceIdentityUpdate() { } - public Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityType? Type { get { throw null; } set { } } - public System.Collections.Generic.IDictionary UserAssignedIdentities { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.PlanetaryComputer.Models.ManagedServiceIdentityUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ProvisioningState : System.IEquatable + public readonly partial struct PlanetaryComputerProvisioningState : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public ProvisioningState(string value) { throw null; } - public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Accepted { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Canceled { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Deleting { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Failed { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Provisioning { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Succeeded { get { throw null; } } - public static Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState Updating { get { throw null; } } - public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState other) { throw null; } + public PlanetaryComputerProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState right) { throw null; } - public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.ProvisioningState right) { throw null; } + public static bool operator ==(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState left, Azure.ResourceManager.PlanetaryComputer.Models.PlanetaryComputerProvisioningState right) { throw null; } public override string ToString() { throw null; } } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ArmPlanetaryComputerModelFactory.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ArmPlanetaryComputerModelFactory.cs index c0cf1974e871..4d810f41534f 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ArmPlanetaryComputerModelFactory.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/ArmPlanetaryComputerModelFactory.cs @@ -16,7 +16,7 @@ namespace Azure.ResourceManager.PlanetaryComputer.Models /// Model factory for models. public static partial class ArmPlanetaryComputerModelFactory { - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -25,12 +25,12 @@ public static partial class ArmPlanetaryComputerModelFactory /// The location. /// The resource-specific properties for this resource. /// The managed service identities assigned to this resource. - /// A new instance for mocking. - public static GeoCatalogData GeoCatalogData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GeoCatalogProperties properties = null, ManagedServiceIdentity identity = null) + /// A new instance for mocking. + public static PlanetaryComputerGeoCatalogData PlanetaryComputerGeoCatalogData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, PlanetaryComputerGeoCatalogProperties properties = null, ManagedServiceIdentity identity = null) { tags ??= new Dictionary(); - return new GeoCatalogData( + return new PlanetaryComputerGeoCatalogData( id, name, resourceType, @@ -42,15 +42,15 @@ public static GeoCatalogData GeoCatalogData(ResourceIdentifier id = null, string serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Tier of the catalog. This cannot be changed after the catalog is created. If not provided, defaults to Basic. /// The URI of the catalog management UI. /// The status of the last operation. /// The scope of the auto-generated domain name label. If not provided, defaults to TenantReuse. - /// A new instance for mocking. - public static GeoCatalogProperties GeoCatalogProperties(CatalogTier? tier = null, string catalogUri = null, ProvisioningState? provisioningState = null, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = null) + /// A new instance for mocking. + public static PlanetaryComputerGeoCatalogProperties PlanetaryComputerGeoCatalogProperties(PlanetaryComputerGeoCatalogTier? tier = null, Uri catalogUri = null, PlanetaryComputerProvisioningState? provisioningState = null, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = null) { - return new GeoCatalogProperties(tier, catalogUri, provisioningState, autoGeneratedDomainNameLabelScope, serializedAdditionalRawData: null); + return new PlanetaryComputerGeoCatalogProperties(tier, catalogUri, provisioningState, autoGeneratedDomainNameLabelScope, serializedAdditionalRawData: null); } } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerArmClient.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerArmClient.cs index ac41b6df6e77..6aa206261c11 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerArmClient.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerArmClient.cs @@ -35,15 +35,15 @@ private string GetApiVersionOrNull(ResourceType resourceType) } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual GeoCatalogResource GetGeoCatalogResource(ResourceIdentifier id) + /// Returns a object. + public virtual PlanetaryComputerGeoCatalogResource GetPlanetaryComputerGeoCatalogResource(ResourceIdentifier id) { - GeoCatalogResource.ValidateResourceId(id); - return new GeoCatalogResource(Client, id); + PlanetaryComputerGeoCatalogResource.ValidateResourceId(id); + return new PlanetaryComputerGeoCatalogResource(Client, id); } } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerResourceGroupResource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerResourceGroupResource.cs index 88c144c45dce..7c6adf036fa8 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerResourceGroupResource.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerResourceGroupResource.cs @@ -33,11 +33,11 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// Gets a collection of GeoCatalogResources in the ResourceGroupResource. - /// An object representing collection of GeoCatalogResources and their operations over a GeoCatalogResource. - public virtual GeoCatalogCollection GetGeoCatalogs() + /// Gets a collection of PlanetaryComputerGeoCatalogResources in the ResourceGroupResource. + /// An object representing collection of PlanetaryComputerGeoCatalogResources and their operations over a PlanetaryComputerGeoCatalogResource. + public virtual PlanetaryComputerGeoCatalogCollection GetPlanetaryComputerGeoCatalogs() { - return GetCachedClient(client => new GeoCatalogCollection(client, Id)); + return GetCachedClient(client => new PlanetaryComputerGeoCatalogCollection(client, Id)); } /// @@ -57,7 +57,7 @@ public virtual GeoCatalogCollection GetGeoCatalogs() /// /// /// Resource - /// + /// /// /// /// @@ -66,9 +66,9 @@ public virtual GeoCatalogCollection GetGeoCatalogs() /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetGeoCatalogAsync(string catalogName, CancellationToken cancellationToken = default) + public virtual async Task> GetPlanetaryComputerGeoCatalogAsync(string catalogName, CancellationToken cancellationToken = default) { - return await GetGeoCatalogs().GetAsync(catalogName, cancellationToken).ConfigureAwait(false); + return await GetPlanetaryComputerGeoCatalogs().GetAsync(catalogName, cancellationToken).ConfigureAwait(false); } /// @@ -88,7 +88,7 @@ public virtual async Task> GetGeoCatalogAsync(strin /// /// /// Resource - /// + /// /// /// /// @@ -97,9 +97,9 @@ public virtual async Task> GetGeoCatalogAsync(strin /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetGeoCatalog(string catalogName, CancellationToken cancellationToken = default) + public virtual Response GetPlanetaryComputerGeoCatalog(string catalogName, CancellationToken cancellationToken = default) { - return GetGeoCatalogs().Get(catalogName, cancellationToken); + return GetPlanetaryComputerGeoCatalogs().Get(catalogName, cancellationToken); } } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerSubscriptionResource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerSubscriptionResource.cs index b657209ab2c4..41fc8a6b6c6f 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerSubscriptionResource.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/MockablePlanetaryComputerSubscriptionResource.cs @@ -15,8 +15,8 @@ namespace Azure.ResourceManager.PlanetaryComputer.Mocking /// A class to add extension methods to SubscriptionResource. public partial class MockablePlanetaryComputerSubscriptionResource : ArmResource { - private ClientDiagnostics _geoCatalogClientDiagnostics; - private GeoCatalogsRestOperations _geoCatalogRestClient; + private ClientDiagnostics _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics; + private GeoCatalogsRestOperations _planetaryComputerGeoCatalogGeoCatalogsRestClient; /// Initializes a new instance of the class for mocking. protected MockablePlanetaryComputerSubscriptionResource() @@ -30,8 +30,8 @@ internal MockablePlanetaryComputerSubscriptionResource(ArmClient client, Resourc { } - private ClientDiagnostics GeoCatalogClientDiagnostics => _geoCatalogClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.PlanetaryComputer", GeoCatalogResource.ResourceType.Namespace, Diagnostics); - private GeoCatalogsRestOperations GeoCatalogRestClient => _geoCatalogRestClient ??= new GeoCatalogsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(GeoCatalogResource.ResourceType)); + private ClientDiagnostics PlanetaryComputerGeoCatalogGeoCatalogsClientDiagnostics => _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.PlanetaryComputer", PlanetaryComputerGeoCatalogResource.ResourceType.Namespace, Diagnostics); + private GeoCatalogsRestOperations PlanetaryComputerGeoCatalogGeoCatalogsRestClient => _planetaryComputerGeoCatalogGeoCatalogsRestClient ??= new GeoCatalogsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(PlanetaryComputerGeoCatalogResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -56,17 +56,17 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetGeoCatalogsAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetPlanetaryComputerGeoCatalogsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => GeoCatalogRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GeoCatalogRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GeoCatalogResource(Client, GeoCatalogData.DeserializeGeoCatalogData(e)), GeoCatalogClientDiagnostics, Pipeline, "MockablePlanetaryComputerSubscriptionResource.GetGeoCatalogs", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => PlanetaryComputerGeoCatalogGeoCatalogsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PlanetaryComputerGeoCatalogGeoCatalogsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PlanetaryComputerGeoCatalogResource(Client, PlanetaryComputerGeoCatalogData.DeserializePlanetaryComputerGeoCatalogData(e)), PlanetaryComputerGeoCatalogGeoCatalogsClientDiagnostics, Pipeline, "MockablePlanetaryComputerSubscriptionResource.GetPlanetaryComputerGeoCatalogs", "value", "nextLink", cancellationToken); } /// @@ -86,17 +86,17 @@ public virtual AsyncPageable GetGeoCatalogsAsync(Cancellatio /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetGeoCatalogs(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetPlanetaryComputerGeoCatalogs(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => GeoCatalogRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GeoCatalogRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GeoCatalogResource(Client, GeoCatalogData.DeserializeGeoCatalogData(e)), GeoCatalogClientDiagnostics, Pipeline, "MockablePlanetaryComputerSubscriptionResource.GetGeoCatalogs", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => PlanetaryComputerGeoCatalogGeoCatalogsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PlanetaryComputerGeoCatalogGeoCatalogsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PlanetaryComputerGeoCatalogResource(Client, PlanetaryComputerGeoCatalogData.DeserializePlanetaryComputerGeoCatalogData(e)), PlanetaryComputerGeoCatalogGeoCatalogsClientDiagnostics, Pipeline, "MockablePlanetaryComputerSubscriptionResource.GetPlanetaryComputerGeoCatalogs", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs index d3ce6d23f989..877e91530d17 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Extensions/PlanetaryComputerExtensions.cs @@ -33,39 +33,39 @@ private static MockablePlanetaryComputerSubscriptionResource GetMockablePlanetar } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static GeoCatalogResource GetGeoCatalogResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static PlanetaryComputerGeoCatalogResource GetPlanetaryComputerGeoCatalogResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockablePlanetaryComputerArmClient(client).GetGeoCatalogResource(id); + return GetMockablePlanetaryComputerArmClient(client).GetPlanetaryComputerGeoCatalogResource(id); } /// - /// Gets a collection of GeoCatalogResources in the ResourceGroupResource. + /// Gets a collection of PlanetaryComputerGeoCatalogResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of GeoCatalogResources and their operations over a GeoCatalogResource. - public static GeoCatalogCollection GetGeoCatalogs(this ResourceGroupResource resourceGroupResource) + /// An object representing collection of PlanetaryComputerGeoCatalogResources and their operations over a PlanetaryComputerGeoCatalogResource. + public static PlanetaryComputerGeoCatalogCollection GetPlanetaryComputerGeoCatalogs(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockablePlanetaryComputerResourceGroupResource(resourceGroupResource).GetGeoCatalogs(); + return GetMockablePlanetaryComputerResourceGroupResource(resourceGroupResource).GetPlanetaryComputerGeoCatalogs(); } /// @@ -85,12 +85,12 @@ public static GeoCatalogCollection GetGeoCatalogs(this ResourceGroupResource res /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -99,11 +99,11 @@ public static GeoCatalogCollection GetGeoCatalogs(this ResourceGroupResource res /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetGeoCatalogAsync(this ResourceGroupResource resourceGroupResource, string catalogName, CancellationToken cancellationToken = default) + public static async Task> GetPlanetaryComputerGeoCatalogAsync(this ResourceGroupResource resourceGroupResource, string catalogName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockablePlanetaryComputerResourceGroupResource(resourceGroupResource).GetGeoCatalogAsync(catalogName, cancellationToken).ConfigureAwait(false); + return await GetMockablePlanetaryComputerResourceGroupResource(resourceGroupResource).GetPlanetaryComputerGeoCatalogAsync(catalogName, cancellationToken).ConfigureAwait(false); } /// @@ -123,12 +123,12 @@ public static async Task> GetGeoCatalogAsync(this R /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -137,11 +137,11 @@ public static async Task> GetGeoCatalogAsync(this R /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetGeoCatalog(this ResourceGroupResource resourceGroupResource, string catalogName, CancellationToken cancellationToken = default) + public static Response GetPlanetaryComputerGeoCatalog(this ResourceGroupResource resourceGroupResource, string catalogName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockablePlanetaryComputerResourceGroupResource(resourceGroupResource).GetGeoCatalog(catalogName, cancellationToken); + return GetMockablePlanetaryComputerResourceGroupResource(resourceGroupResource).GetPlanetaryComputerGeoCatalog(catalogName, cancellationToken); } /// @@ -161,23 +161,23 @@ public static Response GetGeoCatalog(this ResourceGroupResou /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetGeoCatalogsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetPlanetaryComputerGeoCatalogsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockablePlanetaryComputerSubscriptionResource(subscriptionResource).GetGeoCatalogsAsync(cancellationToken); + return GetMockablePlanetaryComputerSubscriptionResource(subscriptionResource).GetPlanetaryComputerGeoCatalogsAsync(cancellationToken); } /// @@ -197,23 +197,23 @@ public static AsyncPageable GetGeoCatalogsAsync(this Subscri /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetGeoCatalogs(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetPlanetaryComputerGeoCatalogs(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockablePlanetaryComputerSubscriptionResource(subscriptionResource).GetGeoCatalogs(cancellationToken); + return GetMockablePlanetaryComputerSubscriptionResource(subscriptionResource).GetPlanetaryComputerGeoCatalogs(cancellationToken); } } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs deleted file mode 100644 index 7bb0af583776..000000000000 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.Serialization.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.PlanetaryComputer -{ - public partial class GeoCatalogResource : IJsonModel - { - private static GeoCatalogData s_dataDeserializationInstance; - private static GeoCatalogData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - GeoCatalogData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerPlanetaryComputerContext.Default); - - GeoCatalogData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerPlanetaryComputerContext.Default); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); - } -} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs deleted file mode 100644 index ec441dd6ca65..000000000000 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/GeoCatalogOperationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.PlanetaryComputer -{ - internal class GeoCatalogOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal GeoCatalogOperationSource(ArmClient client) - { - _client = client; - } - - GeoCatalogResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPlanetaryComputerContext.Default); - return new GeoCatalogResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPlanetaryComputerContext.Default); - return await Task.FromResult(new GeoCatalogResource(_client, data)).ConfigureAwait(false); - } - } -} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerGeoCatalogOperationSource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerGeoCatalogOperationSource.cs new file mode 100644 index 000000000000..9d3b12f7bc4b --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/LongRunningOperation/PlanetaryComputerGeoCatalogOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + internal class PlanetaryComputerGeoCatalogOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal PlanetaryComputerGeoCatalogOperationSource(ArmClient client) + { + _client = client; + } + + PlanetaryComputerGeoCatalogResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPlanetaryComputerContext.Default); + return new PlanetaryComputerGeoCatalogResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerPlanetaryComputerContext.Default); + return await Task.FromResult(new PlanetaryComputerGeoCatalogResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/CatalogTier.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/CatalogTier.cs deleted file mode 100644 index 24f63bb55fbd..000000000000 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/CatalogTier.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.PlanetaryComputer.Models -{ - /// The Microsoft Planetary Computer Pro GeoCatalog tier. - public readonly partial struct CatalogTier : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CatalogTier(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string BasicValue = "Basic"; - - /// The basic tier that utilizes shared resources across catalog instances. - public static CatalogTier Basic { get; } = new CatalogTier(BasicValue); - /// Determines if two values are the same. - public static bool operator ==(CatalogTier left, CatalogTier right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CatalogTier left, CatalogTier right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator CatalogTier(string value) => new CatalogTier(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CatalogTier other && Equals(other); - /// - public bool Equals(CatalogTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs index 602438cefb58..9db2bb012ee5 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.Serialization.cs @@ -83,7 +83,7 @@ internal static GeoCatalogListResult DeserializeGeoCatalogListResult(JsonElement { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -91,10 +91,10 @@ internal static GeoCatalogListResult DeserializeGeoCatalogListResult(JsonElement { if (property.NameEquals("value"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(GeoCatalogData.DeserializeGeoCatalogData(item, options)); + array.Add(PlanetaryComputerGeoCatalogData.DeserializePlanetaryComputerGeoCatalogData(item, options)); } value = array; continue; diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.cs index 23354a592930..782e74c38447 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogListResult.cs @@ -49,7 +49,7 @@ internal partial class GeoCatalogListResult /// Initializes a new instance of . /// The GeoCatalog items on this page. /// is null. - internal GeoCatalogListResult(IEnumerable value) + internal GeoCatalogListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); @@ -60,7 +60,7 @@ internal GeoCatalogListResult(IEnumerable value) /// The GeoCatalog items on this page. /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal GeoCatalogListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + internal GeoCatalogListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -73,7 +73,7 @@ internal GeoCatalogListResult() } /// The GeoCatalog items on this page. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityType.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityType.cs deleted file mode 100644 index 4faeefdaba2f..000000000000 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.PlanetaryComputer.Models -{ - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - public readonly partial struct ManagedServiceIdentityType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ManagedServiceIdentityType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "None"; - private const string SystemAssignedValue = "SystemAssigned"; - private const string UserAssignedValue = "UserAssigned"; - private const string SystemAssignedUserAssignedValue = "SystemAssigned,UserAssigned"; - - /// No managed identity. - public static ManagedServiceIdentityType None { get; } = new ManagedServiceIdentityType(NoneValue); - /// System assigned managed identity. - public static ManagedServiceIdentityType SystemAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedValue); - /// User assigned managed identity. - public static ManagedServiceIdentityType UserAssigned { get; } = new ManagedServiceIdentityType(UserAssignedValue); - /// System and user assigned managed identity. - public static ManagedServiceIdentityType SystemAssignedUserAssigned { get; } = new ManagedServiceIdentityType(SystemAssignedUserAssignedValue); - /// Determines if two values are the same. - public static bool operator ==(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ManagedServiceIdentityType left, ManagedServiceIdentityType right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ManagedServiceIdentityType(string value) => new ManagedServiceIdentityType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ManagedServiceIdentityType other && Equals(other); - /// - public bool Equals(ManagedServiceIdentityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs deleted file mode 100644 index f08503c8b2d9..000000000000 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.Serialization.cs +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.PlanetaryComputer.Models -{ - public partial class ManagedServiceIdentityUpdate : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedServiceIdentityUpdate)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Type)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type.Value.ToString()); - } - if (Optional.IsCollectionDefined(UserAssignedIdentities)) - { - writer.WritePropertyName("userAssignedIdentities"u8); - writer.WriteStartObject(); - foreach (var item in UserAssignedIdentities) - { - writer.WritePropertyName(item.Key); - JsonSerializer.Serialize(writer, item.Value); - } - writer.WriteEndObject(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - ManagedServiceIdentityUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedServiceIdentityUpdate)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedServiceIdentityUpdate(document.RootElement, options); - } - - internal static ManagedServiceIdentityUpdate DeserializeManagedServiceIdentityUpdate(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ManagedServiceIdentityType? type = default; - IDictionary userAssignedIdentities = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type = new ManagedServiceIdentityType(property.Value.GetString()); - continue; - } - if (property.NameEquals("userAssignedIdentities"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, JsonSerializer.Deserialize(property0.Value.GetRawText())); - } - userAssignedIdentities = dictionary; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedServiceIdentityUpdate(type, userAssignedIdentities ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureResourceManagerPlanetaryComputerContext.Default); - default: - throw new FormatException($"The model {nameof(ManagedServiceIdentityUpdate)} does not support writing '{options.Format}' format."); - } - } - - ManagedServiceIdentityUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeManagedServiceIdentityUpdate(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedServiceIdentityUpdate)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.cs deleted file mode 100644 index cfdd66dcd7c1..000000000000 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ManagedServiceIdentityUpdate.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.PlanetaryComputer.Models -{ - /// The template for adding optional properties. - public partial class ManagedServiceIdentityUpdate - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public ManagedServiceIdentityUpdate() - { - UserAssignedIdentities = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// The type of managed identity assigned to this resource. - /// The identities assigned to this resource by the user. - /// Keeps track of any properties unknown to the library. - internal ManagedServiceIdentityUpdate(ManagedServiceIdentityType? type, IDictionary userAssignedIdentities, IDictionary serializedAdditionalRawData) - { - Type = type; - UserAssignedIdentities = userAssignedIdentities; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The type of managed identity assigned to this resource. - public ManagedServiceIdentityType? Type { get; set; } - /// The identities assigned to this resource by the user. - public IDictionary UserAssignedIdentities { get; } - } -} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogPatch.Serialization.cs similarity index 62% rename from sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.Serialization.cs rename to sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogPatch.Serialization.cs index 02ef631b3a18..dd7388f2e69f 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.Serialization.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogPatch.Serialization.cs @@ -10,14 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.PlanetaryComputer.Models { - public partial class GeoCatalogPatch : IUtf8JsonSerializable, IJsonModel + public partial class PlanetaryComputerGeoCatalogPatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +29,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GeoCatalogPatch)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(PlanetaryComputerGeoCatalogPatch)} does not support writing '{format}' format."); } if (Optional.IsCollectionDefined(Tags)) @@ -48,7 +49,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); - writer.WriteObjectValue(Identity, options); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -67,19 +69,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - GeoCatalogPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + PlanetaryComputerGeoCatalogPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GeoCatalogPatch)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(PlanetaryComputerGeoCatalogPatch)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGeoCatalogPatch(document.RootElement, options); + return DeserializePlanetaryComputerGeoCatalogPatch(document.RootElement, options); } - internal static GeoCatalogPatch DeserializeGeoCatalogPatch(JsonElement element, ModelReaderWriterOptions options = null) + internal static PlanetaryComputerGeoCatalogPatch DeserializePlanetaryComputerGeoCatalogPatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -88,7 +90,7 @@ internal static GeoCatalogPatch DeserializeGeoCatalogPatch(JsonElement element, return null; } IDictionary tags = default; - ManagedServiceIdentityUpdate identity = default; + ManagedServiceIdentity identity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -113,7 +115,8 @@ internal static GeoCatalogPatch DeserializeGeoCatalogPatch(JsonElement element, { continue; } - identity = ManagedServiceIdentityUpdate.DeserializeManagedServiceIdentityUpdate(property.Value, options); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); continue; } if (options.Format != "W") @@ -122,38 +125,38 @@ internal static GeoCatalogPatch DeserializeGeoCatalogPatch(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new GeoCatalogPatch(tags ?? new ChangeTrackingDictionary(), identity, serializedAdditionalRawData); + return new PlanetaryComputerGeoCatalogPatch(tags ?? new ChangeTrackingDictionary(), identity, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerPlanetaryComputerContext.Default); default: - throw new FormatException($"The model {nameof(GeoCatalogPatch)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(PlanetaryComputerGeoCatalogPatch)} does not support writing '{options.Format}' format."); } } - GeoCatalogPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + PlanetaryComputerGeoCatalogPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeGeoCatalogPatch(document.RootElement, options); + return DeserializePlanetaryComputerGeoCatalogPatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(GeoCatalogPatch)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(PlanetaryComputerGeoCatalogPatch)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogPatch.cs similarity index 79% rename from sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.cs rename to sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogPatch.cs index e5bd7eb7dc5a..523b6215557f 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogPatch.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogPatch.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.PlanetaryComputer.Models { /// The properties of a GeoCatalog that can be updated. - public partial class GeoCatalogPatch + public partial class PlanetaryComputerGeoCatalogPatch { /// /// Keeps track of any properties unknown to the library. @@ -45,17 +46,17 @@ public partial class GeoCatalogPatch /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public GeoCatalogPatch() + /// Initializes a new instance of . + public PlanetaryComputerGeoCatalogPatch() { Tags = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Resource tags. /// The managed service identity properties to update. /// Keeps track of any properties unknown to the library. - internal GeoCatalogPatch(IDictionary tags, ManagedServiceIdentityUpdate identity, IDictionary serializedAdditionalRawData) + internal PlanetaryComputerGeoCatalogPatch(IDictionary tags, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) { Tags = tags; Identity = identity; @@ -65,6 +66,6 @@ internal GeoCatalogPatch(IDictionary tags, ManagedServiceIdentit /// Resource tags. public IDictionary Tags { get; } /// The managed service identity properties to update. - public ManagedServiceIdentityUpdate Identity { get; set; } + public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogProperties.Serialization.cs similarity index 63% rename from sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.Serialization.cs rename to sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogProperties.Serialization.cs index d6cdbc388b95..755bde2b120e 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.Serialization.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.PlanetaryComputer.Models { - public partial class GeoCatalogProperties : IUtf8JsonSerializable, IJsonModel + public partial class PlanetaryComputerGeoCatalogProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GeoCatalogProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(PlanetaryComputerGeoCatalogProperties)} does not support writing '{format}' format."); } if (Optional.IsDefined(Tier)) @@ -42,7 +42,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (options.Format != "W" && Optional.IsDefined(CatalogUri)) { writer.WritePropertyName("catalogUri"u8); - writer.WriteStringValue(CatalogUri); + writer.WriteStringValue(CatalogUri.AbsoluteUri); } if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { @@ -71,19 +71,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - GeoCatalogProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + PlanetaryComputerGeoCatalogProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GeoCatalogProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(PlanetaryComputerGeoCatalogProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGeoCatalogProperties(document.RootElement, options); + return DeserializePlanetaryComputerGeoCatalogProperties(document.RootElement, options); } - internal static GeoCatalogProperties DeserializeGeoCatalogProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static PlanetaryComputerGeoCatalogProperties DeserializePlanetaryComputerGeoCatalogProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -91,9 +91,9 @@ internal static GeoCatalogProperties DeserializeGeoCatalogProperties(JsonElement { return null; } - CatalogTier? tier = default; - string catalogUri = default; - ProvisioningState? provisioningState = default; + PlanetaryComputerGeoCatalogTier? tier = default; + Uri catalogUri = default; + PlanetaryComputerProvisioningState? provisioningState = default; AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -105,12 +105,16 @@ internal static GeoCatalogProperties DeserializeGeoCatalogProperties(JsonElement { continue; } - tier = new CatalogTier(property.Value.GetString()); + tier = new PlanetaryComputerGeoCatalogTier(property.Value.GetString()); continue; } if (property.NameEquals("catalogUri"u8)) { - catalogUri = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + catalogUri = new Uri(property.Value.GetString()); continue; } if (property.NameEquals("provisioningState"u8)) @@ -119,7 +123,7 @@ internal static GeoCatalogProperties DeserializeGeoCatalogProperties(JsonElement { continue; } - provisioningState = new ProvisioningState(property.Value.GetString()); + provisioningState = new PlanetaryComputerProvisioningState(property.Value.GetString()); continue; } if (property.NameEquals("autoGeneratedDomainNameLabelScope"u8)) @@ -137,38 +141,38 @@ internal static GeoCatalogProperties DeserializeGeoCatalogProperties(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new GeoCatalogProperties(tier, catalogUri, provisioningState, autoGeneratedDomainNameLabelScope, serializedAdditionalRawData); + return new PlanetaryComputerGeoCatalogProperties(tier, catalogUri, provisioningState, autoGeneratedDomainNameLabelScope, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerPlanetaryComputerContext.Default); default: - throw new FormatException($"The model {nameof(GeoCatalogProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(PlanetaryComputerGeoCatalogProperties)} does not support writing '{options.Format}' format."); } } - GeoCatalogProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + PlanetaryComputerGeoCatalogProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeGeoCatalogProperties(document.RootElement, options); + return DeserializePlanetaryComputerGeoCatalogProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(GeoCatalogProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(PlanetaryComputerGeoCatalogProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogProperties.cs similarity index 79% rename from sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.cs rename to sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogProperties.cs index 27b0c519c7fd..1df9b55238bd 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/GeoCatalogProperties.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.PlanetaryComputer.Models { /// The details of the Microsoft Planetary Computer Pro GeoCatalog. - public partial class GeoCatalogProperties + public partial class PlanetaryComputerGeoCatalogProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,18 +45,18 @@ public partial class GeoCatalogProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public GeoCatalogProperties() + /// Initializes a new instance of . + public PlanetaryComputerGeoCatalogProperties() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Tier of the catalog. This cannot be changed after the catalog is created. If not provided, defaults to Basic. /// The URI of the catalog management UI. /// The status of the last operation. /// The scope of the auto-generated domain name label. If not provided, defaults to TenantReuse. /// Keeps track of any properties unknown to the library. - internal GeoCatalogProperties(CatalogTier? tier, string catalogUri, ProvisioningState? provisioningState, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope, IDictionary serializedAdditionalRawData) + internal PlanetaryComputerGeoCatalogProperties(PlanetaryComputerGeoCatalogTier? tier, Uri catalogUri, PlanetaryComputerProvisioningState? provisioningState, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope, IDictionary serializedAdditionalRawData) { Tier = tier; CatalogUri = catalogUri; @@ -66,11 +66,11 @@ internal GeoCatalogProperties(CatalogTier? tier, string catalogUri, Provisioning } /// Tier of the catalog. This cannot be changed after the catalog is created. If not provided, defaults to Basic. - public CatalogTier? Tier { get; set; } + public PlanetaryComputerGeoCatalogTier? Tier { get; set; } /// The URI of the catalog management UI. - public string CatalogUri { get; } + public Uri CatalogUri { get; } /// The status of the last operation. - public ProvisioningState? ProvisioningState { get; } + public PlanetaryComputerProvisioningState? ProvisioningState { get; } /// The scope of the auto-generated domain name label. If not provided, defaults to TenantReuse. public AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get; set; } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogTier.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogTier.cs new file mode 100644 index 000000000000..13889bb44783 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerGeoCatalogTier.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// The Microsoft Planetary Computer Pro GeoCatalog tier. + public readonly partial struct PlanetaryComputerGeoCatalogTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PlanetaryComputerGeoCatalogTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BasicValue = "Basic"; + + /// The basic tier that utilizes shared resources across catalog instances. + public static PlanetaryComputerGeoCatalogTier Basic { get; } = new PlanetaryComputerGeoCatalogTier(BasicValue); + /// Determines if two values are the same. + public static bool operator ==(PlanetaryComputerGeoCatalogTier left, PlanetaryComputerGeoCatalogTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PlanetaryComputerGeoCatalogTier left, PlanetaryComputerGeoCatalogTier right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PlanetaryComputerGeoCatalogTier(string value) => new PlanetaryComputerGeoCatalogTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PlanetaryComputerGeoCatalogTier other && Equals(other); + /// + public bool Equals(PlanetaryComputerGeoCatalogTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerProvisioningState.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerProvisioningState.cs new file mode 100644 index 000000000000..8a62e7d0d88c --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/PlanetaryComputerProvisioningState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.PlanetaryComputer.Models +{ + /// The status of the current operation. + public readonly partial struct PlanetaryComputerProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PlanetaryComputerProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + + /// Resource has been created. + public static PlanetaryComputerProvisioningState Succeeded { get; } = new PlanetaryComputerProvisioningState(SucceededValue); + /// Resource creation failed. + public static PlanetaryComputerProvisioningState Failed { get; } = new PlanetaryComputerProvisioningState(FailedValue); + /// Resource creation was canceled. + public static PlanetaryComputerProvisioningState Canceled { get; } = new PlanetaryComputerProvisioningState(CanceledValue); + /// The catalog is being provisioned. + public static PlanetaryComputerProvisioningState Provisioning { get; } = new PlanetaryComputerProvisioningState(ProvisioningValue); + /// The catalog is being updated. + public static PlanetaryComputerProvisioningState Updating { get; } = new PlanetaryComputerProvisioningState(UpdatingValue); + /// The catalog is being deleted. + public static PlanetaryComputerProvisioningState Deleting { get; } = new PlanetaryComputerProvisioningState(DeletingValue); + /// The catalog request has been accepted. + public static PlanetaryComputerProvisioningState Accepted { get; } = new PlanetaryComputerProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(PlanetaryComputerProvisioningState left, PlanetaryComputerProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PlanetaryComputerProvisioningState left, PlanetaryComputerProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PlanetaryComputerProvisioningState(string value) => new PlanetaryComputerProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PlanetaryComputerProvisioningState other && Equals(other); + /// + public bool Equals(PlanetaryComputerProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ProvisioningState.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ProvisioningState.cs deleted file mode 100644 index 3082d5771f8c..000000000000 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/Models/ProvisioningState.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.PlanetaryComputer.Models -{ - /// The status of the current operation. - public readonly partial struct ProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - private const string CanceledValue = "Canceled"; - private const string ProvisioningValue = "Provisioning"; - private const string UpdatingValue = "Updating"; - private const string DeletingValue = "Deleting"; - private const string AcceptedValue = "Accepted"; - - /// Resource has been created. - public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); - /// Resource creation failed. - public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); - /// Resource creation was canceled. - public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); - /// The catalog is being provisioned. - public static ProvisioningState Provisioning { get; } = new ProvisioningState(ProvisioningValue); - /// The catalog is being updated. - public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); - /// The catalog is being deleted. - public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); - /// The catalog request has been accepted. - public static ProvisioningState Accepted { get; } = new ProvisioningState(AcceptedValue); - /// Determines if two values are the same. - public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); - /// - public bool Equals(ProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogCollection.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogCollection.cs similarity index 64% rename from sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogCollection.cs rename to sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogCollection.cs index fd8b83938ea8..b779a462262e 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogCollection.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogCollection.cs @@ -19,28 +19,28 @@ namespace Azure.ResourceManager.PlanetaryComputer { /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetGeoCatalogs method from an instance of . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetPlanetaryComputerGeoCatalogs method from an instance of . /// - public partial class GeoCatalogCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class PlanetaryComputerGeoCatalogCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _geoCatalogClientDiagnostics; - private readonly GeoCatalogsRestOperations _geoCatalogRestClient; + private readonly ClientDiagnostics _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics; + private readonly GeoCatalogsRestOperations _planetaryComputerGeoCatalogGeoCatalogsRestClient; - /// Initializes a new instance of the class for mocking. - protected GeoCatalogCollection() + /// Initializes a new instance of the class for mocking. + protected PlanetaryComputerGeoCatalogCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal GeoCatalogCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal PlanetaryComputerGeoCatalogCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _geoCatalogClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PlanetaryComputer", GeoCatalogResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(GeoCatalogResource.ResourceType, out string geoCatalogApiVersion); - _geoCatalogRestClient = new GeoCatalogsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, geoCatalogApiVersion); + _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PlanetaryComputer", PlanetaryComputerGeoCatalogResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(PlanetaryComputerGeoCatalogResource.ResourceType, out string planetaryComputerGeoCatalogGeoCatalogsApiVersion); + _planetaryComputerGeoCatalogGeoCatalogsRestClient = new GeoCatalogsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, planetaryComputerGeoCatalogGeoCatalogsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -69,7 +69,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// @@ -79,17 +79,17 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string catalogName, GeoCatalogData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string catalogName, PlanetaryComputerGeoCatalogData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.CreateOrUpdate"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _geoCatalogRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data, cancellationToken).ConfigureAwait(false); - var operation = new PlanetaryComputerArmOperation(new GeoCatalogOperationSource(Client), _geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _planetaryComputerGeoCatalogGeoCatalogsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data, cancellationToken).ConfigureAwait(false); + var operation = new PlanetaryComputerArmOperation(new PlanetaryComputerGeoCatalogOperationSource(Client), _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics, Pipeline, _planetaryComputerGeoCatalogGeoCatalogsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -118,7 +118,7 @@ public virtual async Task> CreateOrUpdateAsync( /// /// /// Resource - /// + /// /// /// /// @@ -128,17 +128,17 @@ public virtual async Task> CreateOrUpdateAsync( /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string catalogName, GeoCatalogData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string catalogName, PlanetaryComputerGeoCatalogData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.CreateOrUpdate"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogCollection.CreateOrUpdate"); scope.Start(); try { - var response = _geoCatalogRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data, cancellationToken); - var operation = new PlanetaryComputerArmOperation(new GeoCatalogOperationSource(Client), _geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _planetaryComputerGeoCatalogGeoCatalogsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data, cancellationToken); + var operation = new PlanetaryComputerArmOperation(new PlanetaryComputerGeoCatalogOperationSource(Client), _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics, Pipeline, _planetaryComputerGeoCatalogGeoCatalogsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, catalogName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnt /// /// /// Resource - /// + /// /// /// /// @@ -175,18 +175,18 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnt /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string catalogName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string catalogName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.Get"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogCollection.Get"); scope.Start(); try { - var response = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken).ConfigureAwait(false); + var response = await _planetaryComputerGeoCatalogGeoCatalogsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new PlanetaryComputerGeoCatalogResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string catalogN /// /// /// Resource - /// + /// /// /// /// @@ -220,18 +220,18 @@ public virtual async Task> GetAsync(string catalogN /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string catalogName, CancellationToken cancellationToken = default) + public virtual Response Get(string catalogName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.Get"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogCollection.Get"); scope.Start(); try { - var response = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken); + var response = _planetaryComputerGeoCatalogGeoCatalogsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new PlanetaryComputerGeoCatalogResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -257,17 +257,17 @@ public virtual Response Get(string catalogName, Cancellation /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _geoCatalogRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _geoCatalogRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GeoCatalogResource(Client, GeoCatalogData.DeserializeGeoCatalogData(e)), _geoCatalogClientDiagnostics, Pipeline, "GeoCatalogCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _planetaryComputerGeoCatalogGeoCatalogsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _planetaryComputerGeoCatalogGeoCatalogsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PlanetaryComputerGeoCatalogResource(Client, PlanetaryComputerGeoCatalogData.DeserializePlanetaryComputerGeoCatalogData(e)), _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics, Pipeline, "PlanetaryComputerGeoCatalogCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -287,17 +287,17 @@ public virtual AsyncPageable GetAllAsync(CancellationToken c /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _geoCatalogRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _geoCatalogRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GeoCatalogResource(Client, GeoCatalogData.DeserializeGeoCatalogData(e)), _geoCatalogClientDiagnostics, Pipeline, "GeoCatalogCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _planetaryComputerGeoCatalogGeoCatalogsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _planetaryComputerGeoCatalogGeoCatalogsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PlanetaryComputerGeoCatalogResource(Client, PlanetaryComputerGeoCatalogData.DeserializePlanetaryComputerGeoCatalogData(e)), _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics, Pipeline, "PlanetaryComputerGeoCatalogCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -317,7 +317,7 @@ public virtual Pageable GetAll(CancellationToken cancellatio /// /// /// Resource - /// + /// /// /// /// @@ -329,11 +329,11 @@ public virtual async Task> ExistsAsync(string catalogName, Cancel { Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.Exists"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogCollection.Exists"); scope.Start(); try { - var response = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _planetaryComputerGeoCatalogGeoCatalogsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string catalogName, Cancel /// /// /// Resource - /// + /// /// /// /// @@ -372,11 +372,11 @@ public virtual Response Exists(string catalogName, CancellationToken cance { Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.Exists"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogCollection.Exists"); scope.Start(); try { - var response = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken); + var response = _planetaryComputerGeoCatalogGeoCatalogsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -403,7 +403,7 @@ public virtual Response Exists(string catalogName, CancellationToken cance /// /// /// Resource - /// + /// /// /// /// @@ -411,18 +411,18 @@ public virtual Response Exists(string catalogName, CancellationToken cance /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string catalogName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string catalogName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.GetIfExists"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogCollection.GetIfExists"); scope.Start(); try { - var response = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _planetaryComputerGeoCatalogGeoCatalogsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new PlanetaryComputerGeoCatalogResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -448,7 +448,7 @@ public virtual async Task> GetIfExistsAsync /// /// /// Resource - /// + /// /// /// /// @@ -456,18 +456,18 @@ public virtual async Task> GetIfExistsAsync /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string catalogName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string catalogName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(catalogName, nameof(catalogName)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogCollection.GetIfExists"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogCollection.GetIfExists"); scope.Start(); try { - var response = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken); + var response = _planetaryComputerGeoCatalogGeoCatalogsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, catalogName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new PlanetaryComputerGeoCatalogResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -476,7 +476,7 @@ public virtual NullableResponse GetIfExists(string catalogNa } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -486,7 +486,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogData.Serialization.cs similarity index 73% rename from sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.Serialization.cs rename to sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogData.Serialization.cs index 4eb3a14dcc42..408f515ecdd7 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.Serialization.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogData.Serialization.cs @@ -15,11 +15,11 @@ namespace Azure.ResourceManager.PlanetaryComputer { - public partial class GeoCatalogData : IUtf8JsonSerializable, IJsonModel + public partial class PlanetaryComputerGeoCatalogData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -30,10 +30,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GeoCatalogData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(PlanetaryComputerGeoCatalogData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -50,19 +50,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - GeoCatalogData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + PlanetaryComputerGeoCatalogData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GeoCatalogData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(PlanetaryComputerGeoCatalogData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGeoCatalogData(document.RootElement, options); + return DeserializePlanetaryComputerGeoCatalogData(document.RootElement, options); } - internal static GeoCatalogData DeserializeGeoCatalogData(JsonElement element, ModelReaderWriterOptions options = null) + internal static PlanetaryComputerGeoCatalogData DeserializePlanetaryComputerGeoCatalogData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -70,7 +70,7 @@ internal static GeoCatalogData DeserializeGeoCatalogData(JsonElement element, Mo { return null; } - GeoCatalogProperties properties = default; + PlanetaryComputerGeoCatalogProperties properties = default; ManagedServiceIdentity identity = default; IDictionary tags = default; AzureLocation location = default; @@ -88,7 +88,7 @@ internal static GeoCatalogData DeserializeGeoCatalogData(JsonElement element, Mo { continue; } - properties = GeoCatalogProperties.DeserializeGeoCatalogProperties(property.Value, options); + properties = PlanetaryComputerGeoCatalogProperties.DeserializePlanetaryComputerGeoCatalogProperties(property.Value, options); continue; } if (property.NameEquals("identity"u8)) @@ -150,7 +150,7 @@ internal static GeoCatalogData DeserializeGeoCatalogData(JsonElement element, Mo } } serializedAdditionalRawData = rawDataDictionary; - return new GeoCatalogData( + return new PlanetaryComputerGeoCatalogData( id, name, type, @@ -162,35 +162,35 @@ internal static GeoCatalogData DeserializeGeoCatalogData(JsonElement element, Mo serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerPlanetaryComputerContext.Default); default: - throw new FormatException($"The model {nameof(GeoCatalogData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(PlanetaryComputerGeoCatalogData)} does not support writing '{options.Format}' format."); } } - GeoCatalogData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + PlanetaryComputerGeoCatalogData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeGeoCatalogData(document.RootElement, options); + return DeserializePlanetaryComputerGeoCatalogData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(GeoCatalogData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(PlanetaryComputerGeoCatalogData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogData.cs similarity index 72% rename from sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.cs rename to sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogData.cs index 37433b9f6e04..6d1414d7d23f 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogData.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.PlanetaryComputer { /// - /// A class representing the GeoCatalog data model. + /// A class representing the PlanetaryComputerGeoCatalog data model. /// A Microsoft Planetary Computer Pro GeoCatalog resource /// - public partial class GeoCatalogData : TrackedResourceData + public partial class PlanetaryComputerGeoCatalogData : TrackedResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,13 +51,13 @@ public partial class GeoCatalogData : TrackedResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The location. - public GeoCatalogData(AzureLocation location) : base(location) + public PlanetaryComputerGeoCatalogData(AzureLocation location) : base(location) { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -67,20 +67,20 @@ public GeoCatalogData(AzureLocation location) : base(location) /// The resource-specific properties for this resource. /// The managed service identities assigned to this resource. /// Keeps track of any properties unknown to the library. - internal GeoCatalogData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GeoCatalogProperties properties, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal PlanetaryComputerGeoCatalogData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, PlanetaryComputerGeoCatalogProperties properties, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Properties = properties; Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal GeoCatalogData() + /// Initializes a new instance of for deserialization. + internal PlanetaryComputerGeoCatalogData() { } /// The resource-specific properties for this resource. - public GeoCatalogProperties Properties { get; set; } + public PlanetaryComputerGeoCatalogProperties Properties { get; set; } /// The managed service identities assigned to this resource. public ManagedServiceIdentity Identity { get; set; } } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogResource.Serialization.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogResource.Serialization.cs new file mode 100644 index 000000000000..749903971c12 --- /dev/null +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogResource.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.PlanetaryComputer +{ + public partial class PlanetaryComputerGeoCatalogResource : IJsonModel + { + private static PlanetaryComputerGeoCatalogData s_dataDeserializationInstance; + private static PlanetaryComputerGeoCatalogData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + PlanetaryComputerGeoCatalogData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerPlanetaryComputerContext.Default); + + PlanetaryComputerGeoCatalogData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerPlanetaryComputerContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogResource.cs similarity index 70% rename from sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.cs rename to sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogResource.cs index d7949132e004..d2319b7cd19a 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/GeoCatalogResource.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/PlanetaryComputerGeoCatalogResource.cs @@ -18,14 +18,14 @@ namespace Azure.ResourceManager.PlanetaryComputer { /// - /// A Class representing a GeoCatalog along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetGeoCatalogResource method. - /// Otherwise you can get one from its parent resource using the GetGeoCatalog method. + /// A Class representing a PlanetaryComputerGeoCatalog along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetPlanetaryComputerGeoCatalogResource method. + /// Otherwise you can get one from its parent resource using the GetPlanetaryComputerGeoCatalog method. /// - public partial class GeoCatalogResource : ArmResource + public partial class PlanetaryComputerGeoCatalogResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. /// The catalogName. @@ -35,35 +35,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _geoCatalogClientDiagnostics; - private readonly GeoCatalogsRestOperations _geoCatalogRestClient; - private readonly GeoCatalogData _data; + private readonly ClientDiagnostics _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics; + private readonly GeoCatalogsRestOperations _planetaryComputerGeoCatalogGeoCatalogsRestClient; + private readonly PlanetaryComputerGeoCatalogData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.Orbital/geoCatalogs"; - /// Initializes a new instance of the class for mocking. - protected GeoCatalogResource() + /// Initializes a new instance of the class for mocking. + protected PlanetaryComputerGeoCatalogResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal GeoCatalogResource(ArmClient client, GeoCatalogData data) : this(client, data.Id) + internal PlanetaryComputerGeoCatalogResource(ArmClient client, PlanetaryComputerGeoCatalogData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal GeoCatalogResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal PlanetaryComputerGeoCatalogResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _geoCatalogClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PlanetaryComputer", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string geoCatalogApiVersion); - _geoCatalogRestClient = new GeoCatalogsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, geoCatalogApiVersion); + _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PlanetaryComputer", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string planetaryComputerGeoCatalogGeoCatalogsApiVersion); + _planetaryComputerGeoCatalogGeoCatalogsRestClient = new GeoCatalogsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, planetaryComputerGeoCatalogGeoCatalogsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -74,7 +74,7 @@ internal GeoCatalogResource(ArmClient client, ResourceIdentifier id) : base(clie /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual GeoCatalogData Data + public virtual PlanetaryComputerGeoCatalogData Data { get { @@ -107,21 +107,21 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Get"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogResource.Get"); scope.Start(); try { - var response = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _planetaryComputerGeoCatalogGeoCatalogsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new PlanetaryComputerGeoCatalogResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -147,21 +147,21 @@ public virtual async Task> GetAsync(CancellationTok /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Get"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogResource.Get"); scope.Start(); try { - var response = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _planetaryComputerGeoCatalogGeoCatalogsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GeoCatalogResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new PlanetaryComputerGeoCatalogResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -187,7 +187,7 @@ public virtual Response Get(CancellationToken cancellationTo /// /// /// Resource - /// + /// /// /// /// @@ -195,12 +195,12 @@ public virtual Response Get(CancellationToken cancellationTo /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Delete"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogResource.Delete"); scope.Start(); try { - var response = await _geoCatalogRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new PlanetaryComputerArmOperation(_geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _planetaryComputerGeoCatalogGeoCatalogsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new PlanetaryComputerArmOperation(_planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics, Pipeline, _planetaryComputerGeoCatalogGeoCatalogsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -229,7 +229,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Resource - /// + /// /// /// /// @@ -237,12 +237,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Delete"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogResource.Delete"); scope.Start(); try { - var response = _geoCatalogRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new PlanetaryComputerArmOperation(_geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _planetaryComputerGeoCatalogGeoCatalogsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new PlanetaryComputerArmOperation(_planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics, Pipeline, _planetaryComputerGeoCatalogGeoCatalogsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -279,16 +279,16 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// The resource properties to be updated. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, GeoCatalogPatch patch, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, PlanetaryComputerGeoCatalogPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Update"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogResource.Update"); scope.Start(); try { - var response = await _geoCatalogRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new PlanetaryComputerArmOperation(new GeoCatalogOperationSource(Client), _geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _planetaryComputerGeoCatalogGeoCatalogsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new PlanetaryComputerArmOperation(new PlanetaryComputerGeoCatalogOperationSource(Client), _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics, Pipeline, _planetaryComputerGeoCatalogGeoCatalogsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -317,7 +317,7 @@ public virtual async Task> UpdateAsync(WaitUnti /// /// /// Resource - /// + /// /// /// /// @@ -325,16 +325,16 @@ public virtual async Task> UpdateAsync(WaitUnti /// The resource properties to be updated. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, GeoCatalogPatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, PlanetaryComputerGeoCatalogPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.Update"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogResource.Update"); scope.Start(); try { - var response = _geoCatalogRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new PlanetaryComputerArmOperation(new GeoCatalogOperationSource(Client), _geoCatalogClientDiagnostics, Pipeline, _geoCatalogRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _planetaryComputerGeoCatalogGeoCatalogsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new PlanetaryComputerArmOperation(new PlanetaryComputerGeoCatalogOperationSource(Client), _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics, Pipeline, _planetaryComputerGeoCatalogGeoCatalogsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -363,7 +363,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, GeoC /// /// /// Resource - /// + /// /// /// /// @@ -371,12 +371,12 @@ public virtual ArmOperation Update(WaitUntil waitUntil, GeoC /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.AddTag"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogResource.AddTag"); scope.Start(); try { @@ -385,13 +385,13 @@ public virtual async Task> AddTagAsync(string key, var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _planetaryComputerGeoCatalogGeoCatalogsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new PlanetaryComputerGeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new GeoCatalogPatch(); + var patch = new PlanetaryComputerGeoCatalogPatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -425,7 +425,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Resource - /// + /// /// /// /// @@ -433,12 +433,12 @@ public virtual async Task> AddTagAsync(string key, /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.AddTag"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogResource.AddTag"); scope.Start(); try { @@ -447,13 +447,13 @@ public virtual Response AddTag(string key, string value, Can var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _planetaryComputerGeoCatalogGeoCatalogsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new PlanetaryComputerGeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new GeoCatalogPatch(); + var patch = new PlanetaryComputerGeoCatalogPatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -487,18 +487,18 @@ public virtual Response AddTag(string key, string value, Can /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.SetTags"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogResource.SetTags"); scope.Start(); try { @@ -508,13 +508,13 @@ public virtual async Task> SetTagsAsync(IDictionary var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _planetaryComputerGeoCatalogGeoCatalogsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new PlanetaryComputerGeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new GeoCatalogPatch(); + var patch = new PlanetaryComputerGeoCatalogPatch(); patch.Tags.ReplaceWith(tags); var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); @@ -544,18 +544,18 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.SetTags"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogResource.SetTags"); scope.Start(); try { @@ -565,13 +565,13 @@ public virtual Response SetTags(IDictionary var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.ReplaceWith(tags); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _planetaryComputerGeoCatalogGeoCatalogsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new PlanetaryComputerGeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new GeoCatalogPatch(); + var patch = new PlanetaryComputerGeoCatalogPatch(); patch.Tags.ReplaceWith(tags); var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); @@ -601,18 +601,18 @@ public virtual Response SetTags(IDictionary /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.RemoveTag"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogResource.RemoveTag"); scope.Start(); try { @@ -621,13 +621,13 @@ public virtual async Task> RemoveTagAsync(string ke var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _geoCatalogRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _planetaryComputerGeoCatalogGeoCatalogsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new PlanetaryComputerGeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new GeoCatalogPatch(); + var patch = new PlanetaryComputerGeoCatalogPatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -661,18 +661,18 @@ public virtual async Task> RemoveTagAsync(string ke /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _geoCatalogClientDiagnostics.CreateScope("GeoCatalogResource.RemoveTag"); + using var scope = _planetaryComputerGeoCatalogGeoCatalogsClientDiagnostics.CreateScope("PlanetaryComputerGeoCatalogResource.RemoveTag"); scope.Start(); try { @@ -681,13 +681,13 @@ public virtual Response RemoveTag(string key, CancellationTo var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _geoCatalogRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new GeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _planetaryComputerGeoCatalogGeoCatalogsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new PlanetaryComputerGeoCatalogResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new GeoCatalogPatch(); + var patch = new PlanetaryComputerGeoCatalogPatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/RestOperations/GeoCatalogsRestOperations.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/RestOperations/GeoCatalogsRestOperations.cs index 9f515e77664d..2de5fbf2e179 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/RestOperations/GeoCatalogsRestOperations.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Generated/RestOperations/GeoCatalogsRestOperations.cs @@ -77,7 +77,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string catalogName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string catalogName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -89,13 +89,13 @@ public async Task> GetAsync(string subscriptionId, stri { case 200: { - GeoCatalogData value = default; + PlanetaryComputerGeoCatalogData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = GeoCatalogData.DeserializeGeoCatalogData(document.RootElement); + value = PlanetaryComputerGeoCatalogData.DeserializePlanetaryComputerGeoCatalogData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((GeoCatalogData)null, message.Response); + return Response.FromValue((PlanetaryComputerGeoCatalogData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -108,7 +108,7 @@ public async Task> GetAsync(string subscriptionId, stri /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string catalogName, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string catalogName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -120,19 +120,19 @@ public Response Get(string subscriptionId, string resourceGroupN { case 200: { - GeoCatalogData value = default; + PlanetaryComputerGeoCatalogData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = GeoCatalogData.DeserializeGeoCatalogData(document.RootElement); + value = PlanetaryComputerGeoCatalogData.DeserializePlanetaryComputerGeoCatalogData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((GeoCatalogData)null, message.Response); + return Response.FromValue((PlanetaryComputerGeoCatalogData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogData data) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string catalogName, PlanetaryComputerGeoCatalogData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -146,7 +146,7 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogData data) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string catalogName, PlanetaryComputerGeoCatalogData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -178,7 +178,7 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogData data, CancellationToken cancellationToken = default) + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string catalogName, PlanetaryComputerGeoCatalogData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -205,7 +205,7 @@ public async Task CreateAsync(string subscriptionId, string resourceGr /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogData data, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string catalogName, PlanetaryComputerGeoCatalogData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -224,7 +224,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string c } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogPatch patch) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string catalogName, PlanetaryComputerGeoCatalogPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -238,7 +238,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogPatch patch) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string catalogName, PlanetaryComputerGeoCatalogPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -270,7 +270,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogPatch patch, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string catalogName, PlanetaryComputerGeoCatalogPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -297,7 +297,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string catalogName, GeoCatalogPatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string catalogName, PlanetaryComputerGeoCatalogPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs index 2b70fe3e4880..4c96e4115661 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/src/Properties/AssemblyInfo.cs @@ -8,4 +8,4 @@ // Replace Microsoft.Test with the correct resource provider namespace for your service and uncomment. // See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers // for the list of possible values. -[assembly: Azure.Core.AzureResourceProviderNamespace("PlanetaryComputer")] +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Spatio")] diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_GeoCatalogCollection.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_PlanetaryComputerGeoCatalogCollection.cs similarity index 81% rename from sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_GeoCatalogCollection.cs rename to sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_PlanetaryComputerGeoCatalogCollection.cs index 9387103e7b6a..98f4af62bce4 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_GeoCatalogCollection.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_PlanetaryComputerGeoCatalogCollection.cs @@ -16,7 +16,7 @@ namespace Azure.ResourceManager.PlanetaryComputer.Samples { - public partial class Sample_GeoCatalogCollection + public partial class Sample_PlanetaryComputerGeoCatalogCollection { [Test] [Ignore("Only validating compilation of examples")] @@ -37,16 +37,16 @@ public async Task CreateOrUpdate_GeoCatalogsCreate() ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this GeoCatalogResource - GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + // get the collection of this PlanetaryComputerGeoCatalogResource + PlanetaryComputerGeoCatalogCollection collection = resourceGroupResource.GetPlanetaryComputerGeoCatalogs(); // invoke the operation string catalogName = "MyCatalog"; - GeoCatalogData data = new GeoCatalogData(new AzureLocation("eastus")) + PlanetaryComputerGeoCatalogData data = new PlanetaryComputerGeoCatalogData(new AzureLocation("eastus")) { - Properties = new GeoCatalogProperties + Properties = new PlanetaryComputerGeoCatalogProperties { - Tier = CatalogTier.Basic, + Tier = PlanetaryComputerGeoCatalogTier.Basic, AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.NoReuse, }, Identity = new ManagedServiceIdentity("UserAssigned") @@ -61,12 +61,12 @@ public async Task CreateOrUpdate_GeoCatalogsCreate() ["MyTag"] = "MyValue" }, }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); - GeoCatalogResource result = lro.Value; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + PlanetaryComputerGeoCatalogResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - GeoCatalogData resourceData = result.Data; + PlanetaryComputerGeoCatalogData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -90,16 +90,16 @@ public async Task Get_GeoCatalogsGet() ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this GeoCatalogResource - GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + // get the collection of this PlanetaryComputerGeoCatalogResource + PlanetaryComputerGeoCatalogCollection collection = resourceGroupResource.GetPlanetaryComputerGeoCatalogs(); // invoke the operation string catalogName = "MyCatalog"; - GeoCatalogResource result = await collection.GetAsync(catalogName); + PlanetaryComputerGeoCatalogResource result = await collection.GetAsync(catalogName); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - GeoCatalogData resourceData = result.Data; + PlanetaryComputerGeoCatalogData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -123,15 +123,15 @@ public async Task GetAll_GeoCatalogsListByResourceGroup() ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this GeoCatalogResource - GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + // get the collection of this PlanetaryComputerGeoCatalogResource + PlanetaryComputerGeoCatalogCollection collection = resourceGroupResource.GetPlanetaryComputerGeoCatalogs(); // invoke the operation and iterate over the result - await foreach (GeoCatalogResource item in collection.GetAllAsync()) + await foreach (PlanetaryComputerGeoCatalogResource item in collection.GetAllAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - GeoCatalogData resourceData = item.Data; + PlanetaryComputerGeoCatalogData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -158,8 +158,8 @@ public async Task Exists_GeoCatalogsGet() ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this GeoCatalogResource - GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + // get the collection of this PlanetaryComputerGeoCatalogResource + PlanetaryComputerGeoCatalogCollection collection = resourceGroupResource.GetPlanetaryComputerGeoCatalogs(); // invoke the operation string catalogName = "MyCatalog"; @@ -187,13 +187,13 @@ public async Task GetIfExists_GeoCatalogsGet() ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this GeoCatalogResource - GeoCatalogCollection collection = resourceGroupResource.GetGeoCatalogs(); + // get the collection of this PlanetaryComputerGeoCatalogResource + PlanetaryComputerGeoCatalogCollection collection = resourceGroupResource.GetPlanetaryComputerGeoCatalogs(); // invoke the operation string catalogName = "MyCatalog"; - NullableResponse response = await collection.GetIfExistsAsync(catalogName); - GeoCatalogResource result = response.HasValue ? response.Value : null; + NullableResponse response = await collection.GetIfExistsAsync(catalogName); + PlanetaryComputerGeoCatalogResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -203,7 +203,7 @@ public async Task GetIfExists_GeoCatalogsGet() { // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - GeoCatalogData resourceData = result.Data; + PlanetaryComputerGeoCatalogData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_GeoCatalogResource.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_PlanetaryComputerGeoCatalogResource.cs similarity index 59% rename from sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_GeoCatalogResource.cs rename to sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_PlanetaryComputerGeoCatalogResource.cs index e65c70ee9e65..c496fc125841 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_GeoCatalogResource.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_PlanetaryComputerGeoCatalogResource.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.PlanetaryComputer.Samples { - public partial class Sample_GeoCatalogResource + public partial class Sample_PlanetaryComputerGeoCatalogResource { [Test] [Ignore("Only validating compilation of examples")] @@ -29,20 +29,20 @@ public async Task Get_GeoCatalogsGet() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this GeoCatalogResource created on azure - // for more information of creating GeoCatalogResource, please refer to the document of GeoCatalogResource + // this example assumes you already have this PlanetaryComputerGeoCatalogResource created on azure + // for more information of creating PlanetaryComputerGeoCatalogResource, please refer to the document of PlanetaryComputerGeoCatalogResource string subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; string resourceGroupName = "MyResourceGroup"; string catalogName = "MyCatalog"; - ResourceIdentifier geoCatalogResourceId = GeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); - GeoCatalogResource geoCatalog = client.GetGeoCatalogResource(geoCatalogResourceId); + ResourceIdentifier planetaryComputerGeoCatalogResourceId = PlanetaryComputerGeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); + PlanetaryComputerGeoCatalogResource planetaryComputerGeoCatalog = client.GetPlanetaryComputerGeoCatalogResource(planetaryComputerGeoCatalogResourceId); // invoke the operation - GeoCatalogResource result = await geoCatalog.GetAsync(); + PlanetaryComputerGeoCatalogResource result = await planetaryComputerGeoCatalog.GetAsync(); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - GeoCatalogData resourceData = result.Data; + PlanetaryComputerGeoCatalogData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -59,16 +59,16 @@ public async Task Delete_GeoCatalogsDelete() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this GeoCatalogResource created on azure - // for more information of creating GeoCatalogResource, please refer to the document of GeoCatalogResource + // this example assumes you already have this PlanetaryComputerGeoCatalogResource created on azure + // for more information of creating PlanetaryComputerGeoCatalogResource, please refer to the document of PlanetaryComputerGeoCatalogResource string subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; string resourceGroupName = "MyResourceGroup"; string catalogName = "MyCatalog"; - ResourceIdentifier geoCatalogResourceId = GeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); - GeoCatalogResource geoCatalog = client.GetGeoCatalogResource(geoCatalogResourceId); + ResourceIdentifier planetaryComputerGeoCatalogResourceId = PlanetaryComputerGeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); + PlanetaryComputerGeoCatalogResource planetaryComputerGeoCatalog = client.GetPlanetaryComputerGeoCatalogResource(planetaryComputerGeoCatalogResourceId); // invoke the operation - await geoCatalog.DeleteAsync(WaitUntil.Completed); + await planetaryComputerGeoCatalog.DeleteAsync(WaitUntil.Completed); Console.WriteLine("Succeeded"); } @@ -85,36 +85,35 @@ public async Task Update_GeoCatalogsUpdate() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this GeoCatalogResource created on azure - // for more information of creating GeoCatalogResource, please refer to the document of GeoCatalogResource + // this example assumes you already have this PlanetaryComputerGeoCatalogResource created on azure + // for more information of creating PlanetaryComputerGeoCatalogResource, please refer to the document of PlanetaryComputerGeoCatalogResource string subscriptionId = "cd9b6cdf-dcf0-4dca-ab19-82be07b74704"; string resourceGroupName = "MyResourceGroup"; string catalogName = "MyCatalog"; - ResourceIdentifier geoCatalogResourceId = GeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); - GeoCatalogResource geoCatalog = client.GetGeoCatalogResource(geoCatalogResourceId); + ResourceIdentifier planetaryComputerGeoCatalogResourceId = PlanetaryComputerGeoCatalogResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, catalogName); + PlanetaryComputerGeoCatalogResource planetaryComputerGeoCatalog = client.GetPlanetaryComputerGeoCatalogResource(planetaryComputerGeoCatalogResourceId); // invoke the operation - GeoCatalogPatch patch = new GeoCatalogPatch + PlanetaryComputerGeoCatalogPatch patch = new PlanetaryComputerGeoCatalogPatch { Tags = { ["MyTag"] = "MyValue" }, - Identity = new ManagedServiceIdentityUpdate + Identity = new ManagedServiceIdentity("UserAssigned") { - Type = Models.ManagedServiceIdentityType.UserAssigned, UserAssignedIdentities = { -["/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity"] = new UserAssignedIdentity() +[new ResourceIdentifier("/subscriptions/cd9b6cdf-dcf0-4dca-ab19-82be07b74704/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity")] = new UserAssignedIdentity() }, }, }; - ArmOperation lro = await geoCatalog.UpdateAsync(WaitUntil.Completed, patch); - GeoCatalogResource result = lro.Value; + ArmOperation lro = await planetaryComputerGeoCatalog.UpdateAsync(WaitUntil.Completed, patch); + PlanetaryComputerGeoCatalogResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - GeoCatalogData resourceData = result.Data; + PlanetaryComputerGeoCatalogData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index cf10b677a84b..d8edd84f5d44 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -18,7 +18,7 @@ public partial class Sample_SubscriptionResourceExtensions { [Test] [Ignore("Only validating compilation of examples")] - public async Task GetGeoCatalogs_GeoCatalogsListBySubscription() + public async Task GetPlanetaryComputerGeoCatalogs_GeoCatalogsListBySubscription() { // Generated from example definition: 2025-02-11-preview/GeoCatalogs_ListBySubscription.json // this example is just showing the usage of "GeoCatalog_ListBySubscription" operation, for the dependent resources, they will have to be created separately. @@ -35,11 +35,11 @@ public async Task GetGeoCatalogs_GeoCatalogsListBySubscription() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation and iterate over the result - await foreach (GeoCatalogResource item in subscriptionResource.GetGeoCatalogsAsync()) + await foreach (PlanetaryComputerGeoCatalogResource item in subscriptionResource.GetPlanetaryComputerGeoCatalogsAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - GeoCatalogData resourceData = item.Data; + PlanetaryComputerGeoCatalogData resourceData = item.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs index fb6616c5158f..c30a26f25944 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tests/Scenario/GeoCatalogCollectionTests.cs @@ -36,10 +36,10 @@ public async Task ListGeoCatalogsInResourceGroup() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); ResourceGroupResource rg = await subscription.GetResourceGroups().GetAsync(ResourceGroupName); - GeoCatalogCollection collection = rg.GetGeoCatalogs(); + PlanetaryComputerGeoCatalogCollection collection = rg.GetPlanetaryComputerGeoCatalogs(); int count = 0; - await foreach (GeoCatalogResource item in collection.GetAllAsync()) + await foreach (PlanetaryComputerGeoCatalogResource item in collection.GetAllAsync()) { TestContext.WriteLine($"GeoCatalog: {item.Data.Name}"); count++; @@ -58,8 +58,8 @@ public async Task GetGeoCatalog() return; } - GeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); - GeoCatalogResource catalog = await collection.GetAsync(ExistingGeoCatalogName); + PlanetaryComputerGeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); + PlanetaryComputerGeoCatalogResource catalog = await collection.GetAsync(ExistingGeoCatalogName); Assert.AreEqual(ExistingGeoCatalogName, catalog.Data.Name); Assert.AreEqual(Region.ToLowerInvariant(), catalog.Data.Location.ToString().ToLowerInvariant()); @@ -71,8 +71,8 @@ public async Task GetGeoCatalog() public async Task CreateGeoCatalog() { string catalogName = Recording.GenerateAssetName("testcatalog-"); - GeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); - GeoCatalogData data = new GeoCatalogData(new AzureLocation(Region)) + PlanetaryComputerGeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); + PlanetaryComputerGeoCatalogData data = new PlanetaryComputerGeoCatalogData(new AzureLocation(Region)) { Identity = new ManagedServiceIdentity(Azure.ResourceManager.Models.ManagedServiceIdentityType.UserAssigned) { @@ -81,19 +81,19 @@ public async Task CreateGeoCatalog() [new ResourceIdentifier($"/subscriptions/ac9a1867-7476-4346-bf8b-968370fe212c/resourceGroups/msi-test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-test-uk-1")] = new UserAssignedIdentity() } }, - Properties = new GeoCatalogProperties + Properties = new PlanetaryComputerGeoCatalogProperties { - Tier = CatalogTier.Basic, + Tier = PlanetaryComputerGeoCatalogTier.Basic, AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.TenantReuse }, Tags = { ["env"] = "test" } }; - ArmOperation operation = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); - GeoCatalogResource result = operation.Value; + ArmOperation operation = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + PlanetaryComputerGeoCatalogResource result = operation.Value; Assert.AreEqual(catalogName, result.Data.Name); - Assert.AreEqual(CatalogTier.Basic, result.Data.Properties.Tier); + Assert.AreEqual(PlanetaryComputerGeoCatalogTier.Basic, result.Data.Properties.Tier); TestContext.WriteLine($"Created GeoCatalog: {result.Id}"); } @@ -102,24 +102,24 @@ public async Task CreateGeoCatalog() public async Task UpdateGeoCatalog() { string catalogName = Recording.GenerateAssetName("testcatalog-"); - GeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); + PlanetaryComputerGeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); - GeoCatalogData data = new GeoCatalogData(new AzureLocation(Region)) + PlanetaryComputerGeoCatalogData data = new PlanetaryComputerGeoCatalogData(new AzureLocation(Region)) { - Properties = new GeoCatalogProperties + Properties = new PlanetaryComputerGeoCatalogProperties { - Tier = CatalogTier.Basic, + Tier = PlanetaryComputerGeoCatalogTier.Basic, AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.TenantReuse }, Tags = { ["env"] = "initial" } }; - ArmOperation createOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); - GeoCatalogResource resource = createOp.Value; + ArmOperation createOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + PlanetaryComputerGeoCatalogResource resource = createOp.Value; resource.Data.Tags["env"] = "updated"; - ArmOperation updateOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, resource.Data); - GeoCatalogResource updated = updateOp.Value; + ArmOperation updateOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, resource.Data); + PlanetaryComputerGeoCatalogResource updated = updateOp.Value; Assert.AreEqual("updated", updated.Data.Tags["env"]); TestContext.WriteLine($"Updated GeoCatalog: {updated.Id}"); @@ -130,20 +130,20 @@ public async Task UpdateGeoCatalog() public async Task DeleteGeoCatalog() { string catalogName = Recording.GenerateAssetName("testcatalog-"); - GeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); + PlanetaryComputerGeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); - GeoCatalogData data = new GeoCatalogData(new AzureLocation(Region)) + PlanetaryComputerGeoCatalogData data = new PlanetaryComputerGeoCatalogData(new AzureLocation(Region)) { - Properties = new GeoCatalogProperties + Properties = new PlanetaryComputerGeoCatalogProperties { - Tier = CatalogTier.Basic, + Tier = PlanetaryComputerGeoCatalogTier.Basic, AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.TenantReuse }, Tags = { ["env"] = "delete" } }; - ArmOperation createOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); - GeoCatalogResource resource = createOp.Value; + ArmOperation createOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + PlanetaryComputerGeoCatalogResource resource = createOp.Value; ArmOperation deleteOp = await resource.DeleteAsync(WaitUntil.Completed); Assert.IsTrue(deleteOp.HasCompleted); @@ -158,10 +158,10 @@ public async Task DeleteGeoCatalog() public async Task ListGeoCatalogsBySubscription() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); - AsyncPageable catalogs = subscription.GetGeoCatalogsAsync(); + AsyncPageable catalogs = subscription.GetPlanetaryComputerGeoCatalogsAsync(); int count = 0; - await foreach (GeoCatalogResource item in catalogs) + await foreach (PlanetaryComputerGeoCatalogResource item in catalogs) { TestContext.WriteLine($"[Subscription List] GeoCatalog: {item.Data.Name}"); count++; @@ -175,29 +175,29 @@ public async Task CreateUpdateDeleteGeoCatalog() Console.WriteLine($"[MODE] Test is running in: {TestEnvironment.Mode}"); string catalogName = Recording.GenerateAssetName("testcatalog-"); - GeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); + PlanetaryComputerGeoCatalogCollection collection = await GetGeoCatalogCollectionAsync(); // Step 1: Create - GeoCatalogData data = new GeoCatalogData(new AzureLocation(Region)) + PlanetaryComputerGeoCatalogData data = new PlanetaryComputerGeoCatalogData(new AzureLocation(Region)) { - Properties = new GeoCatalogProperties + Properties = new PlanetaryComputerGeoCatalogProperties { - Tier = CatalogTier.Basic, + Tier = PlanetaryComputerGeoCatalogTier.Basic, AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.TenantReuse }, Tags = { ["env"] = "initial" } }; - ArmOperation createOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); - GeoCatalogResource resource = createOp.Value; + ArmOperation createOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, data); + PlanetaryComputerGeoCatalogResource resource = createOp.Value; Assert.AreEqual("initial", resource.Data.Tags["env"]); TestContext.WriteLine($"โœ… Created GeoCatalog: {resource.Id}"); // Step 2: Update resource.Data.Tags["env"] = "updated"; - ArmOperation updateOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, resource.Data); - GeoCatalogResource updated = updateOp.Value; + ArmOperation updateOp = await collection.CreateOrUpdateAsync(WaitUntil.Completed, catalogName, resource.Data); + PlanetaryComputerGeoCatalogResource updated = updateOp.Value; Assert.AreEqual("updated", updated.Data.Tags["env"]); TestContext.WriteLine($"๐Ÿ”„ Updated GeoCatalog: {updated.Id}"); @@ -211,11 +211,11 @@ public async Task CreateUpdateDeleteGeoCatalog() TestContext.WriteLine($"โŒ Deleted GeoCatalog: {catalogName}"); } - private async Task GetGeoCatalogCollectionAsync() + private async Task GetGeoCatalogCollectionAsync() { SubscriptionResource subscription = await Client.GetDefaultSubscriptionAsync(); ResourceGroupResource rg = await subscription.GetResourceGroups().GetAsync(ResourceGroupName); - return rg.GetGeoCatalogs(); + return rg.GetPlanetaryComputerGeoCatalogs(); } } } From 169b036be3fa5e2ece70584ad5bbfd0fe3a94e7b Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Mon, 7 Jul 2025 18:28:30 +0800 Subject: [PATCH 41/43] update --- .../Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml index 30ff609c8758..402a7687372d 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/orbitalplanetarycomputer/Orbital.Management -commit: 558870b2064c76be7afdf0c744ffb502a92454c1 +commit: f4ffe8da4c49c1bb5f46662c8d94f207dca6de32 repo: Azure/azure-rest-api-specs additionalDirectories: From 997160d1d044edaaf6ff0939321880d7f41bfe73 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Mon, 7 Jul 2025 18:29:54 +0800 Subject: [PATCH 42/43] update --- .../Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md index a97f1297b3fb..a6b045c902b9 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2025-07-11) ### Features Added From ef8bc180ad7cbd46a6abc32752d8c2ebe7bd3c86 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Thu, 10 Jul 2025 20:34:42 +0800 Subject: [PATCH 43/43] update --- .../Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml index 402a7687372d..3a01e2714bb3 100644 --- a/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml +++ b/sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/orbitalplanetarycomputer/Orbital.Management -commit: f4ffe8da4c49c1bb5f46662c8d94f207dca6de32 +commit: 0eba4483ac56003127af3113b0463c2c6147540e repo: Azure/azure-rest-api-specs additionalDirectories: