diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/Azure.ResourceManager.ProgrammableConnectivity.sln b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/Azure.ResourceManager.ProgrammableConnectivity.sln new file mode 100644 index 000000000000..375576161da5 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/Azure.ResourceManager.ProgrammableConnectivity.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.ProgrammableConnectivity.Samples", "samples\Azure.ResourceManager.ProgrammableConnectivity.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.ProgrammableConnectivity", "src\Azure.ResourceManager.ProgrammableConnectivity.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.ProgrammableConnectivity.Tests", "tests\Azure.ResourceManager.ProgrammableConnectivity.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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/CHANGELOG.md b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/Directory.Build.props b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/README.md b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/README.md new file mode 100644 index 000000000000..f3579a1ce366 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure ProgrammableConnectivity management client library for .NET + +**[Describe the service briefly first.]** + +This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +## Getting started + +### Install the package + +Install the Microsoft Azure ProgrammableConnectivity management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.ProgrammableConnectivity --prerelease +``` + +### Prerequisites + +* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/). + +### Authenticate the Client + +To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). + +## Key concepts + +Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html) + +## Documentation + +Documentation is available to help you learn how to use this package: + +- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). +- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). + +## Examples + +Code samples for using the management library for .NET can be found in the following locations +- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/). + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/api/Azure.ResourceManager.ProgrammableConnectivity.net8.0.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/api/Azure.ResourceManager.ProgrammableConnectivity.net8.0.cs new file mode 100644 index 000000000000..a53b42285c21 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/api/Azure.ResourceManager.ProgrammableConnectivity.net8.0.cs @@ -0,0 +1,905 @@ +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + public partial class AzureResourceManagerProgrammableConnectivityContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerProgrammableConnectivityContext() { } + public static Azure.ResourceManager.ProgrammableConnectivity.AzureResourceManagerProgrammableConnectivityContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } + public partial class GatewayCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected GatewayCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string gatewayName, Azure.ResourceManager.ProgrammableConnectivity.GatewayData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string gatewayName, Azure.ResourceManager.ProgrammableConnectivity.GatewayData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string gatewayName, 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 gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string gatewayName, 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 GatewayData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GatewayData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.ProgrammableConnectivity.Models.GatewayProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.GatewayData 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.ProgrammableConnectivity.GatewayData 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 GatewayResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected GatewayResource() { } + public virtual Azure.ResourceManager.ProgrammableConnectivity.GatewayData 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 gatewayName) { 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.ProgrammableConnectivity.GatewayData 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.ProgrammableConnectivity.GatewayData 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.Response Update(Azure.ResourceManager.ProgrammableConnectivity.Models.GatewayPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ProgrammableConnectivity.Models.GatewayPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class OperatorApiConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected OperatorApiConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string operatorApiConnectionName, Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string operatorApiConnectionName, Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string operatorApiConnectionName, 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 operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string operatorApiConnectionName, 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 OperatorApiConnectionData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OperatorApiConnectionData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiConnectionProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionData 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.ProgrammableConnectivity.OperatorApiConnectionData 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 OperatorApiConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected OperatorApiConnectionResource() { } + public virtual Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionData 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 operatorApiConnectionName) { 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.ProgrammableConnectivity.OperatorApiConnectionData 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.ProgrammableConnectivity.OperatorApiConnectionData 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.ProgrammableConnectivity.Models.OperatorApiConnectionPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiConnectionPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class OperatorApiPlanCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected OperatorApiPlanCollection() { } + public virtual Azure.Response Exists(string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? top = default(int?), int? skip = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? top = default(int?), int? skip = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string operatorApiPlanName, 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 OperatorApiPlanData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperatorApiPlanData() { } + public Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiPlanProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanData 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.ProgrammableConnectivity.OperatorApiPlanData 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 OperatorApiPlanResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected OperatorApiPlanResource() { } + public virtual Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string operatorApiPlanName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanData 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.ProgrammableConnectivity.OperatorApiPlanData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class ProgrammableConnectivityExtensions + { + public static Azure.Response GetGateway(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetGatewayAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.GatewayResource GetGatewayResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.GatewayCollection GetGateways(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetGateways(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetGatewaysAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetOperatorApiConnection(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetOperatorApiConnectionAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionResource GetOperatorApiConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionCollection GetOperatorApiConnections(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetOperatorApiConnections(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetOperatorApiConnectionsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetOperatorApiPlan(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetOperatorApiPlanAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanResource GetOperatorApiPlanResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanCollection GetOperatorApiPlans(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource) { throw null; } + } +} +namespace Azure.ResourceManager.ProgrammableConnectivity.Mocking +{ + public partial class MockableProgrammableConnectivityArmClient : Azure.ResourceManager.ArmResource + { + protected MockableProgrammableConnectivityArmClient() { } + public virtual Azure.ResourceManager.ProgrammableConnectivity.GatewayResource GetGatewayResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionResource GetOperatorApiConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanResource GetOperatorApiPlanResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableProgrammableConnectivityResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableProgrammableConnectivityResourceGroupResource() { } + public virtual Azure.Response GetGateway(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetGatewayAsync(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ProgrammableConnectivity.GatewayCollection GetGateways() { throw null; } + public virtual Azure.Response GetOperatorApiConnection(string operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetOperatorApiConnectionAsync(string operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionCollection GetOperatorApiConnections() { throw null; } + } + public partial class MockableProgrammableConnectivitySubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableProgrammableConnectivitySubscriptionResource() { } + public virtual Azure.Pageable GetGateways(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetGatewaysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetOperatorApiConnections(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetOperatorApiConnectionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetOperatorApiPlan(string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetOperatorApiPlanAsync(string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanCollection GetOperatorApiPlans() { throw null; } + } +} +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + public partial class ApplicationOwnerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ApplicationOwnerProperties(string name, string legalName, string tradingName, string organizationDescription, string taxNumber, Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType organizationType, string organizationIdentificationId, string organizationIdentificationIssuer, string organizationIdentificationType, string contactEmailAddress, Azure.ResourceManager.ProgrammableConnectivity.Models.Person legalRepresentative, Azure.ResourceManager.ProgrammableConnectivity.Models.Person privacyManager, Azure.ResourceManager.ProgrammableConnectivity.Models.Person dataProtectionOfficer, Azure.ResourceManager.ProgrammableConnectivity.Models.GeographicAddress registeredGeographicAddress, System.Uri privacyPolicyUri, System.Collections.Generic.IEnumerable localRepresentatives) { } + public string ContactEmailAddress { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Person DataProtectionOfficer { get { throw null; } set { } } + public string LegalName { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Person LegalRepresentative { get { throw null; } set { } } + public System.Collections.Generic.IList LocalRepresentatives { get { throw null; } } + public string Name { get { throw null; } set { } } + public string OrganizationDescription { get { throw null; } set { } } + public string OrganizationIdentificationId { get { throw null; } set { } } + public string OrganizationIdentificationIssuer { get { throw null; } set { } } + public string OrganizationIdentificationType { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType OrganizationType { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Person PrivacyManager { get { throw null; } set { } } + public System.Uri PrivacyPolicyUri { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.GeographicAddress RegisteredGeographicAddress { get { throw null; } set { } } + public string TaxNumber { get { throw null; } set { } } + public string TradingName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationOwnerProperties 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.ProgrammableConnectivity.Models.ApplicationOwnerProperties 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 ApplicationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ApplicationProperties(string name, string applicationDescription, Azure.ResourceManager.ProgrammableConnectivity.Models.Category category, string commercialName, string privacyRightsRequestEmailAddress, System.Uri privacyPolicyUri) { } + public string ApplicationDescription { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Category Category { get { throw null; } set { } } + public string CommercialName { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public System.Uri PrivacyPolicyUri { get { throw null; } set { } } + public string PrivacyRightsRequestEmailAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationProperties 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.ProgrammableConnectivity.Models.ApplicationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class ArmProgrammableConnectivityModelFactory + { + public static Azure.ResourceManager.ProgrammableConnectivity.GatewayData GatewayData(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.ProgrammableConnectivity.Models.GatewayProperties properties = null) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.GatewayProperties GatewayProperties(System.Collections.Generic.IEnumerable operatorApiConnections = null, string gatewayBaseUri = null, Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState?), Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationProperties configuredApplication = null, Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationOwnerProperties configuredApplicationOwner = null) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.MarketplaceProperties MarketplaceProperties(string offerId = null, string publisherId = null, string planId = null, System.Collections.Generic.IEnumerable planTermsAndConditionsLinks = null) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionData OperatorApiConnectionData(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.ProgrammableConnectivity.Models.OperatorApiConnectionProperties properties = null) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiConnectionProperties OperatorApiConnectionProperties(Azure.Core.ResourceIdentifier operatorApiPlanId = null, Azure.Core.ResourceIdentifier gatewayId = null, string operatorName = null, string camaraApiName = null, Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState?), Azure.ResourceManager.ProgrammableConnectivity.Models.Status status = null, bool planTermsAndConditionsAccepted = false, System.Collections.Generic.IEnumerable planTermsAndConditionsLinks = null, System.Collections.Generic.IEnumerable purposes = null, string purposeReason = null, System.Collections.Generic.IEnumerable dataProcessingList = null) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanData OperatorApiPlanData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiPlanProperties properties = null) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiPlanProperties OperatorApiPlanProperties(string operatorName = null, string camaraApiName = null, System.Collections.Generic.IEnumerable supportedLocations = null, System.Collections.Generic.IEnumerable operatorRegions = null, System.Collections.Generic.IEnumerable markets = null, string limits = null, Azure.ResourceManager.ProgrammableConnectivity.Models.MarketplaceProperties marketplaceProperties = null, Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Status Status(string state = null, string reason = null) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Category : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Category(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Agriculture { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category ArtAndDesign { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category AutoAndVehicle { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Beauty { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category BooksAndReference { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Business { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Construction { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Defense { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category DeveloperTools { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Education { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Engineering { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category EventsAndEntertainment { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Finance { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category FoodAndDrink { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Games { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category HealthAndFitness { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Healthcare { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Information { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Kids { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category LibrariesAndDemo { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Lifestyle { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Manufacturing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category MapsAndNavigation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Media { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Medical { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Mining { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category MusicAndAudio { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category NewsAndMagazines { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Organizations { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Other { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category PhotoAndVideo { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Productivity { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category PublicService { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category RealEstate { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Shopping { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category SocialNetworkingAndCommunications { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Sports { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Tourism { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Trading { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Transportation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category TravelAndLocal { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Utilities { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Water { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Weather { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.Models.Category 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.ProgrammableConnectivity.Models.Category left, Azure.ResourceManager.ProgrammableConnectivity.Models.Category right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.Category (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.Category left, Azure.ResourceManager.ProgrammableConnectivity.Models.Category right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Context : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Context(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context AlgorithmicLogic { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context AssistiveAutomation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context AutomatedDecisionMaking { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context AutomatedScoringOfIndividuals { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context AutomationLevel { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context Autonomous { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotChallengeProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotChallengeProcessInput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotChallengeProcessOutput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotCorrectProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotCorrectProcessInput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotCorrectProcessOutput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotObjectToProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotOptInToProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotOptOutFromProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotReverseProcessEffects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotReverseProcessInput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotReverseProcessOutput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotWithdrawFromProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ChallengingProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ChallengingProcessInput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ChallengingProcessOutput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CompletelyManualProcessing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ConditionalAutomation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ConsentControl { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CorrectingProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CorrectingProcessInput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CorrectingProcessOutput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DataControllerDataSource { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DataPublishedByDataSubject { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DataSource { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DataSubject { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DataSubjectDataSource { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DataSubjectScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DataVolume { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DecisionMaking { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EntityActiveInvolvement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EntityInvolvement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EntityNonInvolvement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EntityNonPermissiveInvolvement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EntityPassiveInvolvement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EntityPermissiveInvolvement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EvaluationOfIndividuals { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EvaluationScoring { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context FullAutomation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context GeographicCoverage { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context GlobalScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HighAutomation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HugeDataVolume { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HugeScaleOfDataSubjects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolved { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolvement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolvementForControl { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolvementForDecision { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolvementForInput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolvementForIntervention { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolvementForOversight { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolvementForVerification { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanNotInvolved { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context InnovativeUseOfExistingTechnology { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context InnovativeUseOfNewTechnologies { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context InnovativeUseOfTechnology { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context LargeDataVolume { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context LargeScaleOfDataSubjects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context LargeScaleProcessing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context LocalEnvironmentScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context LocalityScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context MediumDataVolume { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context MediumScaleOfDataSubjects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context MediumScaleProcessing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context MultiNationalScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context NationalScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context NearlyGlobalScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context NonPublicDataSource { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context NotAutomated { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ObjectingToProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ObtainConsent { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context OptingInToProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context OptingOutFromProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context PartialAutomation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ProcessingCondition { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ProcessingDuration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ProcessingLocation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ProcessingScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ProvideConsent { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context PublicDataSource { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ReaffirmConsent { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context RegionalScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ReversingProcessEffects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ReversingProcessInput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ReversingProcessOutput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context Scale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ScoringOfIndividuals { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SingularDataVolume { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SingularScaleOfDataSubjects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SmallDataVolume { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SmallScaleOfDataSubjects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SmallScaleProcessing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SporadicDataVolume { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SporadicScaleOfDataSubjects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context StorageCondition { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context StorageDeletion { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context StorageDuration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context StorageLocation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context StorageRestoration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SystematicMonitoring { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ThirdPartyDataSource { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context WithdrawConsent { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context WithdrawingFromProcess { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.Models.Context 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.ProgrammableConnectivity.Models.Context left, Azure.ResourceManager.ProgrammableConnectivity.Models.Context right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.Context (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.Context left, Azure.ResourceManager.ProgrammableConnectivity.Models.Context right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataProcessing : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataProcessing(Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation processingOperation, System.Collections.Generic.IEnumerable contexts, Azure.ResourceManager.ProgrammableConnectivity.Models.Duration duration, Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency frequency, System.Collections.Generic.IEnumerable transitRegions, System.Collections.Generic.IEnumerable storageRegions) { } + public System.Collections.Generic.IList Contexts { get { throw null; } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Duration Duration { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency Frequency { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation ProcessingOperation { get { throw null; } set { } } + public System.Collections.Generic.IList StorageRegions { get { throw null; } } + public System.Collections.Generic.IList TransitRegions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.DataProcessing 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.ProgrammableConnectivity.Models.DataProcessing 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 DataRegions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataRegions(string countryCode, bool commercialActivity, System.Uri dataPrivacyFrameworkUri) { } + public bool CommercialActivity { get { throw null; } set { } } + public string CommercialOrganization { get { throw null; } set { } } + public string CountryCode { get { throw null; } set { } } + public System.Uri DataPrivacyFrameworkUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.DataRegions 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.ProgrammableConnectivity.Models.DataRegions 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 Duration : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Duration(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Duration EndlessDuration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Duration FixedOccurrencesDuration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Duration IndeterminateDuration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Duration TemporalDuration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Duration UntilEventDuration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Duration UntilTimeDuration { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.Models.Duration 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.ProgrammableConnectivity.Models.Duration left, Azure.ResourceManager.ProgrammableConnectivity.Models.Duration right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.Duration (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.Duration left, Azure.ResourceManager.ProgrammableConnectivity.Models.Duration right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Frequency : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Frequency(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency ContinuousFrequency { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency OftenFrequency { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency SingularFrequency { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency SporadicFrequency { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency 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.ProgrammableConnectivity.Models.Frequency left, Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency left, Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency right) { throw null; } + public override string ToString() { throw null; } + } + public partial class GatewayPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GatewayPatch() { } + 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.ProgrammableConnectivity.Models.GatewayPatch 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.ProgrammableConnectivity.Models.GatewayPatch 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 GatewayProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GatewayProperties(Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationProperties configuredApplication, Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationOwnerProperties configuredApplicationOwner) { } + public Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationProperties ConfiguredApplication { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationOwnerProperties ConfiguredApplicationOwner { get { throw null; } set { } } + public string GatewayBaseUri { get { throw null; } } + public System.Collections.Generic.IReadOnlyList OperatorApiConnections { get { throw null; } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.GatewayProperties 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.ProgrammableConnectivity.Models.GatewayProperties 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 GeographicAddress : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GeographicAddress(string countryCode) { } + public string City { get { throw null; } set { } } + public string CountryCode { get { throw null; } set { } } + public string Locality { get { throw null; } set { } } + public string PostalCode { get { throw null; } set { } } + public string StateOrProvince { get { throw null; } set { } } + public string StreetName { get { throw null; } set { } } + public string StreetNumber { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.GeographicAddress 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.ProgrammableConnectivity.Models.GeographicAddress 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 LocalRepresentative : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LocalRepresentative(string countryCode, Azure.ResourceManager.ProgrammableConnectivity.Models.Person representative) { } + public string CountryCode { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Person Representative { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.LocalRepresentative 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.ProgrammableConnectivity.Models.LocalRepresentative 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 MarketplaceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MarketplaceProperties() { } + public string OfferId { get { throw null; } } + public string PlanId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PlanTermsAndConditionsLinks { get { throw null; } } + public string PublisherId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.MarketplaceProperties 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.ProgrammableConnectivity.Models.MarketplaceProperties 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 OperatorApiConnectionPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OperatorApiConnectionPatch() { } + public Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiConnectionUpdateProperties Properties { 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.ProgrammableConnectivity.Models.OperatorApiConnectionPatch 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.ProgrammableConnectivity.Models.OperatorApiConnectionPatch 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 OperatorApiConnectionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OperatorApiConnectionProperties(Azure.Core.ResourceIdentifier operatorApiPlanId, Azure.Core.ResourceIdentifier gatewayId, bool planTermsAndConditionsAccepted, System.Collections.Generic.IEnumerable purposes, string purposeReason, System.Collections.Generic.IEnumerable dataProcessingList) { } + public string CamaraApiName { get { throw null; } } + public System.Collections.Generic.IList DataProcessingList { get { throw null; } } + public Azure.Core.ResourceIdentifier GatewayId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier OperatorApiPlanId { get { throw null; } set { } } + public string OperatorName { get { throw null; } } + public bool PlanTermsAndConditionsAccepted { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PlanTermsAndConditionsLinks { get { throw null; } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string PurposeReason { get { throw null; } set { } } + public System.Collections.Generic.IList Purposes { get { throw null; } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Status Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiConnectionProperties 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.ProgrammableConnectivity.Models.OperatorApiConnectionProperties 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 OperatorApiConnectionUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OperatorApiConnectionUpdateProperties() { } + public System.Collections.Generic.IList DataProcessingList { get { throw null; } } + public Azure.Core.ResourceIdentifier OperatorApiPlanId { get { throw null; } set { } } + public bool? PlanTermsAndConditionsAccepted { get { throw null; } set { } } + public string PurposeReason { get { throw null; } set { } } + public System.Collections.Generic.IList Purposes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiConnectionUpdateProperties 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.ProgrammableConnectivity.Models.OperatorApiConnectionUpdateProperties 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 OperatorApiPlanProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperatorApiPlanProperties() { } + public string CamaraApiName { get { throw null; } } + public string Limits { get { throw null; } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.MarketplaceProperties MarketplaceProperties { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Markets { get { throw null; } } + public string OperatorName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList OperatorRegions { get { throw null; } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SupportedLocations { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiPlanProperties 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.ProgrammableConnectivity.Models.OperatorApiPlanProperties 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 OrganizationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OrganizationType(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType AcademicScientificOrganization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType ForProfitOrganization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType GovernmentalOrganization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType IndustryConsortium { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType InternationalOrganization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType NonGovernmentalOrganization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType NonProfitOrganization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType OrganizationalUnit { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType 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.ProgrammableConnectivity.Models.OrganizationType left, Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType left, Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class Person : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Person(string familyName, string givenName, string emailAddress) { } + public string EmailAddress { get { throw null; } set { } } + public string FamilyName { get { throw null; } set { } } + public string GivenName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.Person 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.ProgrammableConnectivity.Models.Person 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 ProcessingOperation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProcessingOperation(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Access { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Acquire { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Adapt { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Aggregate { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Align { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Alter { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Analyze { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Anonymize { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Assess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Collect { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Combine { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Consult { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Copy { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation CrossBorderTransfer { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Delete { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Derive { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Destruct { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Disclose { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation DiscloseByTransmission { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Display { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Disseminate { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Download { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Erase { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Export { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Filter { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Format { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Generate { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Infer { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation MakeAvailable { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Match { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Modify { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Monitor { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Move { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Observe { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Obtain { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Organize { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Profiling { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Pseudonymize { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Query { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Record { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Reformat { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Remove { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Restrict { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Retrieve { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Screen { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Share { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Store { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Structure { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Transfer { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Transform { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Transmit { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Use { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation 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.ProgrammableConnectivity.Models.ProcessingOperation left, Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation left, Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.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.ProgrammableConnectivity.Models.ProvisioningState left, Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState left, Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Purpose : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Purpose(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose AcademicResearch { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose AccountManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose Advertising { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose AgeVerification { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CombatClimateChange { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CommercialPurpose { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CommercialResearch { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CommunicationForCustomerCare { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CommunicationManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CounterMoneyLaundering { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose Counterterrorism { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CreditChecking { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CustomerCare { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CustomerClaimsManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CustomerManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CustomerOrderManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CustomerRelationshipManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CustomerSolvencyMonitoring { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose DataAltruism { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose DeliveryOfGoods { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose DirectMarketing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose DisputeManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose EnforceAccessControl { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose EnforceSecurity { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose EstablishContractualAgreement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose FraudPreventionAndDetection { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose FulfillmentOfContractualObligation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose FulfillmentOfObligation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose HumanResourceManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose IdentityAuthentication { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose IdentityVerification { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ImproveExistingProductsAndServices { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ImproveHealthcare { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ImproveInternalCRMProcesses { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ImprovePublicServices { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ImproveTransportMobility { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose IncreaseServiceRobustness { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose InternalResourceOptimization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose LegalCompliance { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose MaintainCreditCheckingDatabase { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose MaintainCreditRatingDatabase { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose MaintainFraudDatabase { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose Marketing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose MemberPartnerManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose MisusePreventionAndDetection { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose NonCommercialPurpose { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose NonCommercialResearch { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose OptimizationForConsumer { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose OptimizationForController { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose OptimizeUserInterface { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose OrganizationComplianceManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose OrganizationGovernance { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose OrganizationRiskManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PaymentManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose Personalization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PersonalizedAdvertising { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PersonalizedBenefits { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PersonnelHiring { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PersonnelManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PersonnelPayment { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ProtectionOfIPR { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ProtectionOfNationalSecurity { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ProtectionOfPublicSecurity { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ProvideEventRecommendations { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ProvideOfficialStatistics { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ProvidePersonalizedRecommendations { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ProvideProductRecommendations { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PublicBenefit { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PublicPolicyMaking { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PublicRelations { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose RecordManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose RepairImpairments { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose RequestedServiceProvision { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ResearchAndDevelopment { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose RightsFulfillment { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ScientificResearch { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose SearchFunctionalities { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose SellDataToThirdParties { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose SellInsightsFromData { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose SellProducts { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose SellProductsToDataSubject { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose Serviceoptimization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ServicePersonalization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ServiceProvision { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ServiceRegistration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ServiceUsageAnalytics { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose SocialMediaMarketing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose TargetedAdvertising { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose TechnicalServiceProvision { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose UserInterfacePersonalization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose VendorManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose VendorPayment { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose VendorRecordsManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose VendorSelectionAssessment { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose Verification { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose 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.ProgrammableConnectivity.Models.Purpose left, Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose left, Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose right) { throw null; } + public override string ToString() { throw null; } + } + public partial class Status : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal Status() { } + public string Reason { get { throw null; } } + public string State { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.Status 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.ProgrammableConnectivity.Models.Status 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; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/api/Azure.ResourceManager.ProgrammableConnectivity.netstandard2.0.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/api/Azure.ResourceManager.ProgrammableConnectivity.netstandard2.0.cs new file mode 100644 index 000000000000..a53b42285c21 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/api/Azure.ResourceManager.ProgrammableConnectivity.netstandard2.0.cs @@ -0,0 +1,905 @@ +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + public partial class AzureResourceManagerProgrammableConnectivityContext : System.ClientModel.Primitives.ModelReaderWriterContext + { + internal AzureResourceManagerProgrammableConnectivityContext() { } + public static Azure.ResourceManager.ProgrammableConnectivity.AzureResourceManagerProgrammableConnectivityContext Default { get { throw null; } } + protected override bool TryGetTypeBuilderCore(System.Type type, out System.ClientModel.Primitives.ModelReaderWriterTypeBuilder builder) { throw null; } + } + public partial class GatewayCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected GatewayCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string gatewayName, Azure.ResourceManager.ProgrammableConnectivity.GatewayData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string gatewayName, Azure.ResourceManager.ProgrammableConnectivity.GatewayData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string gatewayName, 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 gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string gatewayName, 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 GatewayData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GatewayData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.ProgrammableConnectivity.Models.GatewayProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.GatewayData 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.ProgrammableConnectivity.GatewayData 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 GatewayResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected GatewayResource() { } + public virtual Azure.ResourceManager.ProgrammableConnectivity.GatewayData 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 gatewayName) { 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.ProgrammableConnectivity.GatewayData 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.ProgrammableConnectivity.GatewayData 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.Response Update(Azure.ResourceManager.ProgrammableConnectivity.Models.GatewayPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.ProgrammableConnectivity.Models.GatewayPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class OperatorApiConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected OperatorApiConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string operatorApiConnectionName, Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string operatorApiConnectionName, Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string operatorApiConnectionName, 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 operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string operatorApiConnectionName, 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 OperatorApiConnectionData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OperatorApiConnectionData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiConnectionProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionData 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.ProgrammableConnectivity.OperatorApiConnectionData 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 OperatorApiConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected OperatorApiConnectionResource() { } + public virtual Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionData 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 operatorApiConnectionName) { 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.ProgrammableConnectivity.OperatorApiConnectionData 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.ProgrammableConnectivity.OperatorApiConnectionData 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.ProgrammableConnectivity.Models.OperatorApiConnectionPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiConnectionPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class OperatorApiPlanCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected OperatorApiPlanCollection() { } + public virtual Azure.Response Exists(string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, int? top = default(int?), int? skip = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, int? top = default(int?), int? skip = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string operatorApiPlanName, 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 OperatorApiPlanData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperatorApiPlanData() { } + public Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiPlanProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanData 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.ProgrammableConnectivity.OperatorApiPlanData 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 OperatorApiPlanResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected OperatorApiPlanResource() { } + public virtual Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string operatorApiPlanName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanData 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.ProgrammableConnectivity.OperatorApiPlanData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class ProgrammableConnectivityExtensions + { + public static Azure.Response GetGateway(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetGatewayAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.GatewayResource GetGatewayResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.GatewayCollection GetGateways(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetGateways(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetGatewaysAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetOperatorApiConnection(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetOperatorApiConnectionAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionResource GetOperatorApiConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionCollection GetOperatorApiConnections(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetOperatorApiConnections(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetOperatorApiConnectionsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetOperatorApiPlan(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetOperatorApiPlanAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanResource GetOperatorApiPlanResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanCollection GetOperatorApiPlans(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource) { throw null; } + } +} +namespace Azure.ResourceManager.ProgrammableConnectivity.Mocking +{ + public partial class MockableProgrammableConnectivityArmClient : Azure.ResourceManager.ArmResource + { + protected MockableProgrammableConnectivityArmClient() { } + public virtual Azure.ResourceManager.ProgrammableConnectivity.GatewayResource GetGatewayResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionResource GetOperatorApiConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanResource GetOperatorApiPlanResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableProgrammableConnectivityResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableProgrammableConnectivityResourceGroupResource() { } + public virtual Azure.Response GetGateway(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetGatewayAsync(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ProgrammableConnectivity.GatewayCollection GetGateways() { throw null; } + public virtual Azure.Response GetOperatorApiConnection(string operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetOperatorApiConnectionAsync(string operatorApiConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionCollection GetOperatorApiConnections() { throw null; } + } + public partial class MockableProgrammableConnectivitySubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableProgrammableConnectivitySubscriptionResource() { } + public virtual Azure.Pageable GetGateways(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetGatewaysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetOperatorApiConnections(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetOperatorApiConnectionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetOperatorApiPlan(string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetOperatorApiPlanAsync(string operatorApiPlanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanCollection GetOperatorApiPlans() { throw null; } + } +} +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + public partial class ApplicationOwnerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ApplicationOwnerProperties(string name, string legalName, string tradingName, string organizationDescription, string taxNumber, Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType organizationType, string organizationIdentificationId, string organizationIdentificationIssuer, string organizationIdentificationType, string contactEmailAddress, Azure.ResourceManager.ProgrammableConnectivity.Models.Person legalRepresentative, Azure.ResourceManager.ProgrammableConnectivity.Models.Person privacyManager, Azure.ResourceManager.ProgrammableConnectivity.Models.Person dataProtectionOfficer, Azure.ResourceManager.ProgrammableConnectivity.Models.GeographicAddress registeredGeographicAddress, System.Uri privacyPolicyUri, System.Collections.Generic.IEnumerable localRepresentatives) { } + public string ContactEmailAddress { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Person DataProtectionOfficer { get { throw null; } set { } } + public string LegalName { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Person LegalRepresentative { get { throw null; } set { } } + public System.Collections.Generic.IList LocalRepresentatives { get { throw null; } } + public string Name { get { throw null; } set { } } + public string OrganizationDescription { get { throw null; } set { } } + public string OrganizationIdentificationId { get { throw null; } set { } } + public string OrganizationIdentificationIssuer { get { throw null; } set { } } + public string OrganizationIdentificationType { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType OrganizationType { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Person PrivacyManager { get { throw null; } set { } } + public System.Uri PrivacyPolicyUri { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.GeographicAddress RegisteredGeographicAddress { get { throw null; } set { } } + public string TaxNumber { get { throw null; } set { } } + public string TradingName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationOwnerProperties 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.ProgrammableConnectivity.Models.ApplicationOwnerProperties 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 ApplicationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ApplicationProperties(string name, string applicationDescription, Azure.ResourceManager.ProgrammableConnectivity.Models.Category category, string commercialName, string privacyRightsRequestEmailAddress, System.Uri privacyPolicyUri) { } + public string ApplicationDescription { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Category Category { get { throw null; } set { } } + public string CommercialName { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public System.Uri PrivacyPolicyUri { get { throw null; } set { } } + public string PrivacyRightsRequestEmailAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationProperties 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.ProgrammableConnectivity.Models.ApplicationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class ArmProgrammableConnectivityModelFactory + { + public static Azure.ResourceManager.ProgrammableConnectivity.GatewayData GatewayData(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.ProgrammableConnectivity.Models.GatewayProperties properties = null) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.GatewayProperties GatewayProperties(System.Collections.Generic.IEnumerable operatorApiConnections = null, string gatewayBaseUri = null, Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState?), Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationProperties configuredApplication = null, Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationOwnerProperties configuredApplicationOwner = null) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.MarketplaceProperties MarketplaceProperties(string offerId = null, string publisherId = null, string planId = null, System.Collections.Generic.IEnumerable planTermsAndConditionsLinks = null) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.OperatorApiConnectionData OperatorApiConnectionData(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.ProgrammableConnectivity.Models.OperatorApiConnectionProperties properties = null) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiConnectionProperties OperatorApiConnectionProperties(Azure.Core.ResourceIdentifier operatorApiPlanId = null, Azure.Core.ResourceIdentifier gatewayId = null, string operatorName = null, string camaraApiName = null, Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState?), Azure.ResourceManager.ProgrammableConnectivity.Models.Status status = null, bool planTermsAndConditionsAccepted = false, System.Collections.Generic.IEnumerable planTermsAndConditionsLinks = null, System.Collections.Generic.IEnumerable purposes = null, string purposeReason = null, System.Collections.Generic.IEnumerable dataProcessingList = null) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.OperatorApiPlanData OperatorApiPlanData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiPlanProperties properties = null) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiPlanProperties OperatorApiPlanProperties(string operatorName = null, string camaraApiName = null, System.Collections.Generic.IEnumerable supportedLocations = null, System.Collections.Generic.IEnumerable operatorRegions = null, System.Collections.Generic.IEnumerable markets = null, string limits = null, Azure.ResourceManager.ProgrammableConnectivity.Models.MarketplaceProperties marketplaceProperties = null, Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Status Status(string state = null, string reason = null) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Category : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Category(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Agriculture { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category ArtAndDesign { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category AutoAndVehicle { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Beauty { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category BooksAndReference { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Business { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Construction { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Defense { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category DeveloperTools { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Education { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Engineering { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category EventsAndEntertainment { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Finance { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category FoodAndDrink { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Games { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category HealthAndFitness { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Healthcare { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Information { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Kids { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category LibrariesAndDemo { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Lifestyle { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Manufacturing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category MapsAndNavigation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Media { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Medical { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Mining { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category MusicAndAudio { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category NewsAndMagazines { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Organizations { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Other { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category PhotoAndVideo { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Productivity { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category PublicService { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category RealEstate { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Shopping { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category SocialNetworkingAndCommunications { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Sports { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Tourism { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Trading { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Transportation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category TravelAndLocal { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Utilities { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Water { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Category Weather { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.Models.Category 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.ProgrammableConnectivity.Models.Category left, Azure.ResourceManager.ProgrammableConnectivity.Models.Category right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.Category (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.Category left, Azure.ResourceManager.ProgrammableConnectivity.Models.Category right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Context : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Context(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context AlgorithmicLogic { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context AssistiveAutomation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context AutomatedDecisionMaking { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context AutomatedScoringOfIndividuals { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context AutomationLevel { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context Autonomous { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotChallengeProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotChallengeProcessInput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotChallengeProcessOutput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotCorrectProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotCorrectProcessInput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotCorrectProcessOutput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotObjectToProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotOptInToProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotOptOutFromProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotReverseProcessEffects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotReverseProcessInput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotReverseProcessOutput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CannotWithdrawFromProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ChallengingProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ChallengingProcessInput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ChallengingProcessOutput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CompletelyManualProcessing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ConditionalAutomation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ConsentControl { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CorrectingProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CorrectingProcessInput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context CorrectingProcessOutput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DataControllerDataSource { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DataPublishedByDataSubject { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DataSource { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DataSubject { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DataSubjectDataSource { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DataSubjectScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DataVolume { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context DecisionMaking { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EntityActiveInvolvement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EntityInvolvement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EntityNonInvolvement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EntityNonPermissiveInvolvement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EntityPassiveInvolvement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EntityPermissiveInvolvement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EvaluationOfIndividuals { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context EvaluationScoring { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context FullAutomation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context GeographicCoverage { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context GlobalScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HighAutomation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HugeDataVolume { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HugeScaleOfDataSubjects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolved { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolvement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolvementForControl { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolvementForDecision { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolvementForInput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolvementForIntervention { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolvementForOversight { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanInvolvementForVerification { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context HumanNotInvolved { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context InnovativeUseOfExistingTechnology { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context InnovativeUseOfNewTechnologies { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context InnovativeUseOfTechnology { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context LargeDataVolume { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context LargeScaleOfDataSubjects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context LargeScaleProcessing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context LocalEnvironmentScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context LocalityScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context MediumDataVolume { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context MediumScaleOfDataSubjects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context MediumScaleProcessing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context MultiNationalScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context NationalScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context NearlyGlobalScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context NonPublicDataSource { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context NotAutomated { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ObjectingToProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ObtainConsent { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context OptingInToProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context OptingOutFromProcess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context PartialAutomation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ProcessingCondition { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ProcessingDuration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ProcessingLocation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ProcessingScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ProvideConsent { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context PublicDataSource { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ReaffirmConsent { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context RegionalScale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ReversingProcessEffects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ReversingProcessInput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ReversingProcessOutput { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context Scale { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ScoringOfIndividuals { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SingularDataVolume { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SingularScaleOfDataSubjects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SmallDataVolume { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SmallScaleOfDataSubjects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SmallScaleProcessing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SporadicDataVolume { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SporadicScaleOfDataSubjects { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context StorageCondition { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context StorageDeletion { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context StorageDuration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context StorageLocation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context StorageRestoration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context SystematicMonitoring { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context ThirdPartyDataSource { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context WithdrawConsent { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Context WithdrawingFromProcess { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.Models.Context 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.ProgrammableConnectivity.Models.Context left, Azure.ResourceManager.ProgrammableConnectivity.Models.Context right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.Context (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.Context left, Azure.ResourceManager.ProgrammableConnectivity.Models.Context right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataProcessing : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataProcessing(Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation processingOperation, System.Collections.Generic.IEnumerable contexts, Azure.ResourceManager.ProgrammableConnectivity.Models.Duration duration, Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency frequency, System.Collections.Generic.IEnumerable transitRegions, System.Collections.Generic.IEnumerable storageRegions) { } + public System.Collections.Generic.IList Contexts { get { throw null; } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Duration Duration { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency Frequency { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation ProcessingOperation { get { throw null; } set { } } + public System.Collections.Generic.IList StorageRegions { get { throw null; } } + public System.Collections.Generic.IList TransitRegions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.DataProcessing 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.ProgrammableConnectivity.Models.DataProcessing 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 DataRegions : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataRegions(string countryCode, bool commercialActivity, System.Uri dataPrivacyFrameworkUri) { } + public bool CommercialActivity { get { throw null; } set { } } + public string CommercialOrganization { get { throw null; } set { } } + public string CountryCode { get { throw null; } set { } } + public System.Uri DataPrivacyFrameworkUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.DataRegions 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.ProgrammableConnectivity.Models.DataRegions 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 Duration : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Duration(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Duration EndlessDuration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Duration FixedOccurrencesDuration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Duration IndeterminateDuration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Duration TemporalDuration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Duration UntilEventDuration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Duration UntilTimeDuration { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.Models.Duration 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.ProgrammableConnectivity.Models.Duration left, Azure.ResourceManager.ProgrammableConnectivity.Models.Duration right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.Duration (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.Duration left, Azure.ResourceManager.ProgrammableConnectivity.Models.Duration right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Frequency : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Frequency(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency ContinuousFrequency { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency OftenFrequency { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency SingularFrequency { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency SporadicFrequency { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency 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.ProgrammableConnectivity.Models.Frequency left, Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency left, Azure.ResourceManager.ProgrammableConnectivity.Models.Frequency right) { throw null; } + public override string ToString() { throw null; } + } + public partial class GatewayPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GatewayPatch() { } + 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.ProgrammableConnectivity.Models.GatewayPatch 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.ProgrammableConnectivity.Models.GatewayPatch 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 GatewayProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GatewayProperties(Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationProperties configuredApplication, Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationOwnerProperties configuredApplicationOwner) { } + public Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationProperties ConfiguredApplication { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.ApplicationOwnerProperties ConfiguredApplicationOwner { get { throw null; } set { } } + public string GatewayBaseUri { get { throw null; } } + public System.Collections.Generic.IReadOnlyList OperatorApiConnections { get { throw null; } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.GatewayProperties 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.ProgrammableConnectivity.Models.GatewayProperties 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 GeographicAddress : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GeographicAddress(string countryCode) { } + public string City { get { throw null; } set { } } + public string CountryCode { get { throw null; } set { } } + public string Locality { get { throw null; } set { } } + public string PostalCode { get { throw null; } set { } } + public string StateOrProvince { get { throw null; } set { } } + public string StreetName { get { throw null; } set { } } + public string StreetNumber { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.GeographicAddress 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.ProgrammableConnectivity.Models.GeographicAddress 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 LocalRepresentative : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LocalRepresentative(string countryCode, Azure.ResourceManager.ProgrammableConnectivity.Models.Person representative) { } + public string CountryCode { get { throw null; } set { } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Person Representative { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.LocalRepresentative 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.ProgrammableConnectivity.Models.LocalRepresentative 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 MarketplaceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MarketplaceProperties() { } + public string OfferId { get { throw null; } } + public string PlanId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList PlanTermsAndConditionsLinks { get { throw null; } } + public string PublisherId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.MarketplaceProperties 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.ProgrammableConnectivity.Models.MarketplaceProperties 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 OperatorApiConnectionPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OperatorApiConnectionPatch() { } + public Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiConnectionUpdateProperties Properties { 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.ProgrammableConnectivity.Models.OperatorApiConnectionPatch 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.ProgrammableConnectivity.Models.OperatorApiConnectionPatch 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 OperatorApiConnectionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OperatorApiConnectionProperties(Azure.Core.ResourceIdentifier operatorApiPlanId, Azure.Core.ResourceIdentifier gatewayId, bool planTermsAndConditionsAccepted, System.Collections.Generic.IEnumerable purposes, string purposeReason, System.Collections.Generic.IEnumerable dataProcessingList) { } + public string CamaraApiName { get { throw null; } } + public System.Collections.Generic.IList DataProcessingList { get { throw null; } } + public Azure.Core.ResourceIdentifier GatewayId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier OperatorApiPlanId { get { throw null; } set { } } + public string OperatorName { get { throw null; } } + public bool PlanTermsAndConditionsAccepted { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PlanTermsAndConditionsLinks { get { throw null; } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public string PurposeReason { get { throw null; } set { } } + public System.Collections.Generic.IList Purposes { get { throw null; } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.Status Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiConnectionProperties 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.ProgrammableConnectivity.Models.OperatorApiConnectionProperties 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 OperatorApiConnectionUpdateProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OperatorApiConnectionUpdateProperties() { } + public System.Collections.Generic.IList DataProcessingList { get { throw null; } } + public Azure.Core.ResourceIdentifier OperatorApiPlanId { get { throw null; } set { } } + public bool? PlanTermsAndConditionsAccepted { get { throw null; } set { } } + public string PurposeReason { get { throw null; } set { } } + public System.Collections.Generic.IList Purposes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiConnectionUpdateProperties 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.ProgrammableConnectivity.Models.OperatorApiConnectionUpdateProperties 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 OperatorApiPlanProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OperatorApiPlanProperties() { } + public string CamaraApiName { get { throw null; } } + public string Limits { get { throw null; } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.MarketplaceProperties MarketplaceProperties { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Markets { get { throw null; } } + public string OperatorName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList OperatorRegions { get { throw null; } } + public Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SupportedLocations { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.OperatorApiPlanProperties 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.ProgrammableConnectivity.Models.OperatorApiPlanProperties 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 OrganizationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OrganizationType(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType AcademicScientificOrganization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType ForProfitOrganization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType GovernmentalOrganization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType IndustryConsortium { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType InternationalOrganization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType NonGovernmentalOrganization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType NonProfitOrganization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType OrganizationalUnit { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType 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.ProgrammableConnectivity.Models.OrganizationType left, Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType left, Azure.ResourceManager.ProgrammableConnectivity.Models.OrganizationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class Person : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Person(string familyName, string givenName, string emailAddress) { } + public string EmailAddress { get { throw null; } set { } } + public string FamilyName { get { throw null; } set { } } + public string GivenName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.Person 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.ProgrammableConnectivity.Models.Person 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 ProcessingOperation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProcessingOperation(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Access { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Acquire { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Adapt { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Aggregate { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Align { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Alter { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Analyze { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Anonymize { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Assess { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Collect { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Combine { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Consult { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Copy { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation CrossBorderTransfer { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Delete { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Derive { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Destruct { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Disclose { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation DiscloseByTransmission { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Display { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Disseminate { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Download { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Erase { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Export { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Filter { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Format { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Generate { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Infer { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation MakeAvailable { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Match { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Modify { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Monitor { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Move { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Observe { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Obtain { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Organize { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Profiling { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Pseudonymize { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Query { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Record { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Reformat { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Remove { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Restrict { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Retrieve { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Screen { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Share { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Store { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Structure { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Transfer { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Transform { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Transmit { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation Use { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation 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.ProgrammableConnectivity.Models.ProcessingOperation left, Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation left, Azure.ResourceManager.ProgrammableConnectivity.Models.ProcessingOperation right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.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.ProgrammableConnectivity.Models.ProvisioningState left, Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState left, Azure.ResourceManager.ProgrammableConnectivity.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Purpose : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Purpose(string value) { throw null; } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose AcademicResearch { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose AccountManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose Advertising { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose AgeVerification { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CombatClimateChange { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CommercialPurpose { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CommercialResearch { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CommunicationForCustomerCare { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CommunicationManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CounterMoneyLaundering { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose Counterterrorism { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CreditChecking { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CustomerCare { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CustomerClaimsManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CustomerManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CustomerOrderManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CustomerRelationshipManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose CustomerSolvencyMonitoring { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose DataAltruism { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose DeliveryOfGoods { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose DirectMarketing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose DisputeManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose EnforceAccessControl { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose EnforceSecurity { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose EstablishContractualAgreement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose FraudPreventionAndDetection { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose FulfillmentOfContractualObligation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose FulfillmentOfObligation { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose HumanResourceManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose IdentityAuthentication { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose IdentityVerification { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ImproveExistingProductsAndServices { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ImproveHealthcare { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ImproveInternalCRMProcesses { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ImprovePublicServices { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ImproveTransportMobility { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose IncreaseServiceRobustness { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose InternalResourceOptimization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose LegalCompliance { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose MaintainCreditCheckingDatabase { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose MaintainCreditRatingDatabase { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose MaintainFraudDatabase { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose Marketing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose MemberPartnerManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose MisusePreventionAndDetection { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose NonCommercialPurpose { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose NonCommercialResearch { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose OptimizationForConsumer { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose OptimizationForController { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose OptimizeUserInterface { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose OrganizationComplianceManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose OrganizationGovernance { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose OrganizationRiskManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PaymentManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose Personalization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PersonalizedAdvertising { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PersonalizedBenefits { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PersonnelHiring { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PersonnelManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PersonnelPayment { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ProtectionOfIPR { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ProtectionOfNationalSecurity { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ProtectionOfPublicSecurity { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ProvideEventRecommendations { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ProvideOfficialStatistics { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ProvidePersonalizedRecommendations { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ProvideProductRecommendations { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PublicBenefit { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PublicPolicyMaking { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose PublicRelations { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose RecordManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose RepairImpairments { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose RequestedServiceProvision { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ResearchAndDevelopment { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose RightsFulfillment { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ScientificResearch { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose SearchFunctionalities { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose SellDataToThirdParties { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose SellInsightsFromData { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose SellProducts { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose SellProductsToDataSubject { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose Serviceoptimization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ServicePersonalization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ServiceProvision { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ServiceRegistration { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose ServiceUsageAnalytics { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose SocialMediaMarketing { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose TargetedAdvertising { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose TechnicalServiceProvision { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose UserInterfacePersonalization { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose VendorManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose VendorPayment { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose VendorRecordsManagement { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose VendorSelectionAssessment { get { throw null; } } + public static Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose Verification { get { throw null; } } + public bool Equals(Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose 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.ProgrammableConnectivity.Models.Purpose left, Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose right) { throw null; } + public static implicit operator Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose left, Azure.ResourceManager.ProgrammableConnectivity.Models.Purpose right) { throw null; } + public override string ToString() { throw null; } + } + public partial class Status : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal Status() { } + public string Reason { get { throw null; } } + public string State { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ProgrammableConnectivity.Models.Status 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.ProgrammableConnectivity.Models.Status 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; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/assets.json b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/assets.json new file mode 100644 index 000000000000..8386106de816 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity", + "Tag": "" +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Azure.ResourceManager.ProgrammableConnectivity.Samples.csproj b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Azure.ResourceManager.ProgrammableConnectivity.Samples.csproj new file mode 100644 index 000000000000..9d77a73791b7 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Azure.ResourceManager.ProgrammableConnectivity.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_GatewayCollection.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_GatewayCollection.cs new file mode 100644 index 000000000000..5f2fc227de61 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_GatewayCollection.cs @@ -0,0 +1,230 @@ +// 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.ProgrammableConnectivity.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Samples +{ + public partial class Sample_GatewayCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_GatewaysCreateOrUpdateMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/Gateways_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "Gateway_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GatewayResource + GatewayCollection collection = resourceGroupResource.GetGateways(); + + // invoke the operation + string gatewayName = "GatewayName"; + GatewayData data = new GatewayData(new AzureLocation("eastus")) + { + Properties = new GatewayProperties(new ApplicationProperties( + "Application Name", + "Application description", + Category.ArtAndDesign, + "Contoso", + "contact@contoso.com", + new Uri("http://contoso.com/privacy")), new ApplicationOwnerProperties( + "Contoso", + "Contoso", + "Contoso", + "Description of Organisation", + "12345", + OrganizationType.AcademicScientificOrganization, + "12345", + "ID issuer", + "Tax number", + "contact@contoso.com", + new Person("Name", "Name", "contact@contoso.com"), + new Person("Name", "Name", "contact@contoso.com"), + new Person("Name", "Name", "contact@contoso.com"), + new GeographicAddress("US") + { + StreetNumber = "1234", + StreetName = "Street", + Locality = "Locality", + City = "City", + StateOrProvince = "State", + PostalCode = "12345", + }, + new Uri("http://contoso.com/privacy"), + new LocalRepresentative[] + { +new LocalRepresentative("AA", new Person("Name", "Name", "contact@contoso.com")) + })), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, gatewayName, data); + GatewayResource 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 + GatewayData 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_GatewaysGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/Gateways_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Gateway_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 = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GatewayResource + GatewayCollection collection = resourceGroupResource.GetGateways(); + + // invoke the operation + string gatewayName = "GatewayName"; + GatewayResource result = await collection.GetAsync(gatewayName); + + // 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 + GatewayData 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_GatewaysListByResourceGroupMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/Gateways_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "Gateway_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 = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GatewayResource + GatewayCollection collection = resourceGroupResource.GetGateways(); + + // invoke the operation and iterate over the result + await foreach (GatewayResource 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 + GatewayData 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_GatewaysGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/Gateways_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Gateway_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 = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GatewayResource + GatewayCollection collection = resourceGroupResource.GetGateways(); + + // invoke the operation + string gatewayName = "GatewayName"; + bool result = await collection.ExistsAsync(gatewayName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GatewaysGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/Gateways_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Gateway_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 = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this GatewayResource + GatewayCollection collection = resourceGroupResource.GetGateways(); + + // invoke the operation + string gatewayName = "GatewayName"; + NullableResponse response = await collection.GetIfExistsAsync(gatewayName); + GatewayResource 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 + GatewayData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_GatewayResource.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_GatewayResource.cs new file mode 100644 index 000000000000..90f3b8c8f648 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_GatewayResource.cs @@ -0,0 +1,109 @@ +// 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.ProgrammableConnectivity.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Samples +{ + public partial class Sample_GatewayResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GatewaysGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/Gateways_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Gateway_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 GatewayResource created on azure + // for more information of creating GatewayResource, please refer to the document of GatewayResource + string subscriptionId = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + string gatewayName = "GatewayName"; + ResourceIdentifier gatewayResourceId = GatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); + GatewayResource gateway = client.GetGatewayResource(gatewayResourceId); + + // invoke the operation + GatewayResource result = await gateway.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 + GatewayData 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_GatewaysDeleteMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/Gateways_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "Gateway_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 GatewayResource created on azure + // for more information of creating GatewayResource, please refer to the document of GatewayResource + string subscriptionId = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + string gatewayName = "GatewayName"; + ResourceIdentifier gatewayResourceId = GatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); + GatewayResource gateway = client.GetGatewayResource(gatewayResourceId); + + // invoke the operation + await gateway.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_GatewaysUpdateMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/Gateways_Update_MaximumSet_Gen.json + // this example is just showing the usage of "Gateway_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 GatewayResource created on azure + // for more information of creating GatewayResource, please refer to the document of GatewayResource + string subscriptionId = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + string gatewayName = "GatewayName"; + ResourceIdentifier gatewayResourceId = GatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); + GatewayResource gateway = client.GetGatewayResource(gatewayResourceId); + + // invoke the operation + GatewayPatch patch = new GatewayPatch + { + Tags = { }, + }; + GatewayResource result = await gateway.UpdateAsync(patch); + + // 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 + GatewayData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_OperatorApiConnectionCollection.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_OperatorApiConnectionCollection.cs new file mode 100644 index 000000000000..3a13261569dd --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_OperatorApiConnectionCollection.cs @@ -0,0 +1,224 @@ +// 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.ProgrammableConnectivity.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Samples +{ + public partial class Sample_OperatorApiConnectionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_OperatorApiConnectionsCreateMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/OperatorApiConnections_Create_MaximumSet_Gen.json + // this example is just showing the usage of "OperatorApiConnection_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 = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this OperatorApiConnectionResource + OperatorApiConnectionCollection collection = resourceGroupResource.GetOperatorApiConnections(); + + // invoke the operation + string operatorApiConnectionName = "operatorApiConnectionName"; + OperatorApiConnectionData data = new OperatorApiConnectionData(new AzureLocation("eastus")) + { + Properties = new OperatorApiConnectionProperties( + new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-00000000000/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/livmzrh"), + new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/example-rg/providers/Microsoft.ProgrammableConnectivity/gateways/cdvcixxcdhjqw"), + true, + new Purpose[] { new Purpose("Fraud Detection and Prevention") }, + "This application uses this API for this purpose because...", + new DataProcessing[] + { +new DataProcessing( + ProcessingOperation.Access, + new Context[]{Context.AlgorithmicLogic}, + Duration.EndlessDuration, + Frequency.ContinuousFrequency, + new DataRegions[] +{ +new DataRegions("AA", true, new Uri("https://www.dataprivacyframework.gov/participant/0")) +{ +CommercialOrganization = "Contoso", +} +}, + new DataRegions[] +{ +new DataRegions("AA", true, new Uri("https://www.dataprivacyframework.gov/participant/0")) +{ +CommercialOrganization = "Contoso", +} +}) + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, operatorApiConnectionName, data); + OperatorApiConnectionResource 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 + OperatorApiConnectionData 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_OperatorApiConnectionsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/OperatorApiConnections_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OperatorApiConnection_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 = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this OperatorApiConnectionResource + OperatorApiConnectionCollection collection = resourceGroupResource.GetOperatorApiConnections(); + + // invoke the operation + string operatorApiConnectionName = "operatorApiConnectionName"; + OperatorApiConnectionResource result = await collection.GetAsync(operatorApiConnectionName); + + // 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 + OperatorApiConnectionData 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_OperatorApiConnectionsListByResourceGroupMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/OperatorApiConnections_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "OperatorApiConnection_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 = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this OperatorApiConnectionResource + OperatorApiConnectionCollection collection = resourceGroupResource.GetOperatorApiConnections(); + + // invoke the operation and iterate over the result + await foreach (OperatorApiConnectionResource 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 + OperatorApiConnectionData 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_OperatorApiConnectionsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/OperatorApiConnections_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OperatorApiConnection_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 = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this OperatorApiConnectionResource + OperatorApiConnectionCollection collection = resourceGroupResource.GetOperatorApiConnections(); + + // invoke the operation + string operatorApiConnectionName = "operatorApiConnectionName"; + bool result = await collection.ExistsAsync(operatorApiConnectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_OperatorApiConnectionsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/OperatorApiConnections_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OperatorApiConnection_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 = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this OperatorApiConnectionResource + OperatorApiConnectionCollection collection = resourceGroupResource.GetOperatorApiConnections(); + + // invoke the operation + string operatorApiConnectionName = "operatorApiConnectionName"; + NullableResponse response = await collection.GetIfExistsAsync(operatorApiConnectionName); + OperatorApiConnectionResource 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 + OperatorApiConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_OperatorApiConnectionResource.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_OperatorApiConnectionResource.cs new file mode 100644 index 000000000000..2b3d5cb454f7 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_OperatorApiConnectionResource.cs @@ -0,0 +1,136 @@ +// 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.ProgrammableConnectivity.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Samples +{ + public partial class Sample_OperatorApiConnectionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_OperatorApiConnectionsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/OperatorApiConnections_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OperatorApiConnection_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 OperatorApiConnectionResource created on azure + // for more information of creating OperatorApiConnectionResource, please refer to the document of OperatorApiConnectionResource + string subscriptionId = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + string operatorApiConnectionName = "operatorApiConnectionName"; + ResourceIdentifier operatorApiConnectionResourceId = OperatorApiConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, operatorApiConnectionName); + OperatorApiConnectionResource operatorApiConnection = client.GetOperatorApiConnectionResource(operatorApiConnectionResourceId); + + // invoke the operation + OperatorApiConnectionResource result = await operatorApiConnection.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 + OperatorApiConnectionData 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_OperatorApiConnectionsDeleteMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/OperatorApiConnections_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "OperatorApiConnection_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 OperatorApiConnectionResource created on azure + // for more information of creating OperatorApiConnectionResource, please refer to the document of OperatorApiConnectionResource + string subscriptionId = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + string operatorApiConnectionName = "operatorApiConnectionName"; + ResourceIdentifier operatorApiConnectionResourceId = OperatorApiConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, operatorApiConnectionName); + OperatorApiConnectionResource operatorApiConnection = client.GetOperatorApiConnectionResource(operatorApiConnectionResourceId); + + // invoke the operation + await operatorApiConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_OperatorApiConnectionsUpdateMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/OperatorApiConnections_Update_MaximumSet_Gen.json + // this example is just showing the usage of "OperatorApiConnection_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 OperatorApiConnectionResource created on azure + // for more information of creating OperatorApiConnectionResource, please refer to the document of OperatorApiConnectionResource + string subscriptionId = "93519EA0-206F-42A3-8126-A234F19328E0"; + string resourceGroupName = "rgopenapi"; + string operatorApiConnectionName = "operatorApiConnectionName"; + ResourceIdentifier operatorApiConnectionResourceId = OperatorApiConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, operatorApiConnectionName); + OperatorApiConnectionResource operatorApiConnection = client.GetOperatorApiConnectionResource(operatorApiConnectionResourceId); + + // invoke the operation + OperatorApiConnectionPatch patch = new OperatorApiConnectionPatch + { + Tags = { }, + Properties = new OperatorApiConnectionUpdateProperties + { + OperatorApiPlanId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-00000000000/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/livmzrh"), + PlanTermsAndConditionsAccepted = true, + Purposes = { new Purpose("Fraud Detection and Prevention") }, + PurposeReason = "This application uses this API for this purpose because...", + DataProcessingList = {new DataProcessing( + ProcessingOperation.Access, + new Context[]{Context.AlgorithmicLogic}, + Duration.EndlessDuration, + Frequency.ContinuousFrequency, + new DataRegions[] +{ +new DataRegions("AA", true, new Uri("https://www.dataprivacyframework.gov/participant/0")) +{ +CommercialOrganization = "Contoso", +} +}, + new DataRegions[] +{ +new DataRegions("AA", true, new Uri("https://www.dataprivacyframework.gov/participant/0")) +{ +CommercialOrganization = "Contoso", +} +})}, + }, + }; + ArmOperation lro = await operatorApiConnection.UpdateAsync(WaitUntil.Completed, patch); + OperatorApiConnectionResource 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 + OperatorApiConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_OperatorApiPlanCollection.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_OperatorApiPlanCollection.cs new file mode 100644 index 000000000000..63efb5a39cc0 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_OperatorApiPlanCollection.cs @@ -0,0 +1,156 @@ +// 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.ProgrammableConnectivity.Samples +{ + public partial class Sample_OperatorApiPlanCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_OperatorApiPlansGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/OperatorApiPlans_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OperatorApiPlan_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "93519EA0-206F-42A3-8126-A234F19328E0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this OperatorApiPlanResource + OperatorApiPlanCollection collection = subscriptionResource.GetOperatorApiPlans(); + + // invoke the operation + string operatorApiPlanName = "operatorApiPlanName"; + OperatorApiPlanResource result = await collection.GetAsync(operatorApiPlanName); + + // 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 + OperatorApiPlanData 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_OperatorApiPlansListBySubscriptionMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/OperatorApiPlans_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "OperatorApiPlan_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 = "93519EA0-206F-42A3-8126-A234F19328E0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this OperatorApiPlanResource + OperatorApiPlanCollection collection = subscriptionResource.GetOperatorApiPlans(); + + // invoke the operation and iterate over the result + string filter = "lbnapngejadkls"; + int? top = 18; + int? skip = 2; + await foreach (OperatorApiPlanResource item in collection.GetAllAsync(filter: filter, top: top, skip: skip)) + { + // 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 + OperatorApiPlanData 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_OperatorApiPlansGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/OperatorApiPlans_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OperatorApiPlan_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "93519EA0-206F-42A3-8126-A234F19328E0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this OperatorApiPlanResource + OperatorApiPlanCollection collection = subscriptionResource.GetOperatorApiPlans(); + + // invoke the operation + string operatorApiPlanName = "operatorApiPlanName"; + bool result = await collection.ExistsAsync(operatorApiPlanName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_OperatorApiPlansGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/OperatorApiPlans_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OperatorApiPlan_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "93519EA0-206F-42A3-8126-A234F19328E0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this OperatorApiPlanResource + OperatorApiPlanCollection collection = subscriptionResource.GetOperatorApiPlans(); + + // invoke the operation + string operatorApiPlanName = "operatorApiPlanName"; + NullableResponse response = await collection.GetIfExistsAsync(operatorApiPlanName); + OperatorApiPlanResource 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 + OperatorApiPlanData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_OperatorApiPlanResource.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_OperatorApiPlanResource.cs new file mode 100644 index 000000000000..91a1a3b33224 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_OperatorApiPlanResource.cs @@ -0,0 +1,47 @@ +// 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 NUnit.Framework; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Samples +{ + public partial class Sample_OperatorApiPlanResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_OperatorApiPlansGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/OperatorApiPlans_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OperatorApiPlan_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 OperatorApiPlanResource created on azure + // for more information of creating OperatorApiPlanResource, please refer to the document of OperatorApiPlanResource + string subscriptionId = "93519EA0-206F-42A3-8126-A234F19328E0"; + string operatorApiPlanName = "operatorApiPlanName"; + ResourceIdentifier operatorApiPlanResourceId = OperatorApiPlanResource.CreateResourceIdentifier(subscriptionId, operatorApiPlanName); + OperatorApiPlanResource operatorApiPlan = client.GetOperatorApiPlanResource(operatorApiPlanResourceId); + + // invoke the operation + OperatorApiPlanResource result = await operatorApiPlan.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 + OperatorApiPlanData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..2df1f2e39503 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,81 @@ +// 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.ProgrammableConnectivity.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetGateways_GatewaysListBySubscriptionMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/Gateways_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "Gateway_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 = "93519EA0-206F-42A3-8126-A234F19328E0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (GatewayResource item in subscriptionResource.GetGatewaysAsync()) + { + // 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 + GatewayData 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 GetOperatorApiConnections_OperatorApiConnectionsListBySubscriptionMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-30-preview/OperatorApiConnections_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "OperatorApiConnection_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 = "93519EA0-206F-42A3-8126-A234F19328E0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (OperatorApiConnectionResource item in subscriptionResource.GetOperatorApiConnectionsAsync()) + { + // 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 + OperatorApiConnectionData 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Azure.ResourceManager.ProgrammableConnectivity.csproj b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Azure.ResourceManager.ProgrammableConnectivity.csproj new file mode 100644 index 000000000000..84f16edfa400 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Azure.ResourceManager.ProgrammableConnectivity.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider ProgrammableConnectivity. + 1.0.0-beta.1 + azure;management;arm;resource manager;programmableconnectivity + Azure.ResourceManager.ProgrammableConnectivity + + diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/ArmProgrammableConnectivityModelFactory.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/ArmProgrammableConnectivityModelFactory.cs new file mode 100644 index 000000000000..771215bdb065 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/ArmProgrammableConnectivityModelFactory.cs @@ -0,0 +1,198 @@ +// 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.ProgrammableConnectivity.Models +{ + /// Model factory for models. + public static partial class ArmProgrammableConnectivityModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static GatewayData GatewayData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, GatewayProperties properties = null) + { + tags ??= new Dictionary(); + + return new GatewayData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// List of Operator API Connections selected by the user. + /// Base URL of the Gateway resource. This is the URL that the users would use to make Network API requests to the Operators via Azure. + /// The status of the last operation on the Gateway resource. + /// Details about the Application that would use the Operator's Network APIs. + /// Details about the Organization owning the Application that would use the Operator's Network APIs. + /// A new instance for mocking. + public static GatewayProperties GatewayProperties(IEnumerable operatorApiConnections = null, string gatewayBaseUri = null, ProvisioningState? provisioningState = null, ApplicationProperties configuredApplication = null, ApplicationOwnerProperties configuredApplicationOwner = null) + { + operatorApiConnections ??= new List(); + + return new GatewayProperties( + operatorApiConnections?.ToList(), + gatewayBaseUri, + provisioningState, + configuredApplication, + configuredApplicationOwner, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static OperatorApiConnectionData OperatorApiConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, OperatorApiConnectionProperties properties = null) + { + tags ??= new Dictionary(); + + return new OperatorApiConnectionData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Reference to the Operator API Plan Resource ID. + /// Reference to the APC Gateway resource ID. + /// Name of the Operator in the linked Operator API Plan belongs to. + /// The Network API for the current operator in the country/region provided in the linked Operator API Plan. + /// The status of the last operation. + /// The status of the OperatorApiConnection resource. + /// + /// Whether the caller has accepted the Terms and Conditions of the associated Operator API Plan. + /// After creation, the planTermsAndConditionsLink property is set to the Terms and Conditions that + /// have been accepted. + /// + /// Must be set to True, as the Terms and Conditions must be accepted. + /// + /// Links to the Terms and Conditions of the Operator API Plan that were accepted on creation. + /// The purpose for which the Application will use the API. Max Items 1 currently as Operators do not support multiple. + /// Explanation of the reason that justifies the purpose: specifically why is the API used for the application's use case. + /// List of ways the data returned on this API is processed. + /// A new instance for mocking. + public static OperatorApiConnectionProperties OperatorApiConnectionProperties(ResourceIdentifier operatorApiPlanId = null, ResourceIdentifier gatewayId = null, string operatorName = null, string camaraApiName = null, ProvisioningState? provisioningState = null, Status status = null, bool planTermsAndConditionsAccepted = default, IEnumerable planTermsAndConditionsLinks = null, IEnumerable purposes = null, string purposeReason = null, IEnumerable dataProcessingList = null) + { + planTermsAndConditionsLinks ??= new List(); + purposes ??= new List(); + dataProcessingList ??= new List(); + + return new OperatorApiConnectionProperties( + operatorApiPlanId, + gatewayId, + operatorName, + camaraApiName, + provisioningState, + status, + planTermsAndConditionsAccepted, + planTermsAndConditionsLinks?.ToList(), + purposes?.ToList(), + purposeReason, + dataProcessingList?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Current state of the OperatorApiConnection resource. + /// Explanation of the current state of the OperatorApiConnection resource. + /// A new instance for mocking. + public static Status Status(string state = null, string reason = null) + { + return new Status(state, reason, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static OperatorApiPlanData OperatorApiPlanData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, OperatorApiPlanProperties properties = null) + { + return new OperatorApiPlanData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Name of the Operator this plan belongs to. + /// Standardized Network API name defined by CAMARA specifications. + /// List of Azure regions where this offer is supported. + /// List of country/region names where this plan is being supported by the Operator. + /// List of country/region names where this plan is being supported by Azure Marketplace. + /// The limits, if any, will be imposed by the operator. + /// Azure marketplace properties for this plan. + /// The status of the last operation on the Gateway resource. + /// A new instance for mocking. + public static OperatorApiPlanProperties OperatorApiPlanProperties(string operatorName = null, string camaraApiName = null, IEnumerable supportedLocations = null, IEnumerable operatorRegions = null, IEnumerable markets = null, string limits = null, MarketplaceProperties marketplaceProperties = null, ProvisioningState? provisioningState = null) + { + supportedLocations ??= new List(); + operatorRegions ??= new List(); + markets ??= new List(); + + return new OperatorApiPlanProperties( + operatorName, + camaraApiName, + supportedLocations?.ToList(), + operatorRegions?.ToList(), + markets?.ToList(), + limits, + marketplaceProperties, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Azure marketplace Offer ID for this plan. + /// Azure marketplace Publisher ID for this plan. + /// Azure marketplace Plan ID for this plan. + /// + /// Links to the Terms and Conditions of the Plan that must be accepted to create an + /// associated Operator Api Connection + /// + /// A new instance for mocking. + public static MarketplaceProperties MarketplaceProperties(string offerId = null, string publisherId = null, string planId = null, IEnumerable planTermsAndConditionsLinks = null) + { + planTermsAndConditionsLinks ??= new List(); + + return new MarketplaceProperties(offerId, publisherId, planId, planTermsAndConditionsLinks?.ToList(), serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Extensions/MockableProgrammableConnectivityArmClient.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Extensions/MockableProgrammableConnectivityArmClient.cs new file mode 100644 index 000000000000..e456161d7846 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Extensions/MockableProgrammableConnectivityArmClient.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableProgrammableConnectivityArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableProgrammableConnectivityArmClient() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableProgrammableConnectivityArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableProgrammableConnectivityArmClient(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 GatewayResource GetGatewayResource(ResourceIdentifier id) + { + GatewayResource.ValidateResourceId(id); + return new GatewayResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OperatorApiConnectionResource GetOperatorApiConnectionResource(ResourceIdentifier id) + { + OperatorApiConnectionResource.ValidateResourceId(id); + return new OperatorApiConnectionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OperatorApiPlanResource GetOperatorApiPlanResource(ResourceIdentifier id) + { + OperatorApiPlanResource.ValidateResourceId(id); + return new OperatorApiPlanResource(Client, id); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Extensions/MockableProgrammableConnectivityResourceGroupResource.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Extensions/MockableProgrammableConnectivityResourceGroupResource.cs new file mode 100644 index 000000000000..4333b4d47c26 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Extensions/MockableProgrammableConnectivityResourceGroupResource.cs @@ -0,0 +1,174 @@ +// 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.ProgrammableConnectivity.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableProgrammableConnectivityResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableProgrammableConnectivityResourceGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableProgrammableConnectivityResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of GatewayResources in the ResourceGroupResource. + /// An object representing collection of GatewayResources and their operations over a GatewayResource. + public virtual GatewayCollection GetGateways() + { + return GetCachedClient(client => new GatewayCollection(client, Id)); + } + + /// + /// Get a Gateway resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity Gateway Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGatewayAsync(string gatewayName, CancellationToken cancellationToken = default) + { + return await GetGateways().GetAsync(gatewayName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Gateway resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity Gateway Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGateway(string gatewayName, CancellationToken cancellationToken = default) + { + return GetGateways().Get(gatewayName, cancellationToken); + } + + /// Gets a collection of OperatorApiConnectionResources in the ResourceGroupResource. + /// An object representing collection of OperatorApiConnectionResources and their operations over a OperatorApiConnectionResource. + public virtual OperatorApiConnectionCollection GetOperatorApiConnections() + { + return GetCachedClient(client => new OperatorApiConnectionCollection(client, Id)); + } + + /// + /// Get an Operator API Connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetOperatorApiConnectionAsync(string operatorApiConnectionName, CancellationToken cancellationToken = default) + { + return await GetOperatorApiConnections().GetAsync(operatorApiConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an Operator API Connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetOperatorApiConnection(string operatorApiConnectionName, CancellationToken cancellationToken = default) + { + return GetOperatorApiConnections().Get(operatorApiConnectionName, cancellationToken); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Extensions/MockableProgrammableConnectivitySubscriptionResource.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Extensions/MockableProgrammableConnectivitySubscriptionResource.cs new file mode 100644 index 000000000000..8aa523966403 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Extensions/MockableProgrammableConnectivitySubscriptionResource.cs @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableProgrammableConnectivitySubscriptionResource : ArmResource + { + private ClientDiagnostics _gatewayClientDiagnostics; + private GatewaysRestOperations _gatewayRestClient; + private ClientDiagnostics _operatorApiConnectionClientDiagnostics; + private OperatorApiConnectionsRestOperations _operatorApiConnectionRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableProgrammableConnectivitySubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableProgrammableConnectivitySubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics GatewayClientDiagnostics => _gatewayClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ProgrammableConnectivity", GatewayResource.ResourceType.Namespace, Diagnostics); + private GatewaysRestOperations GatewayRestClient => _gatewayRestClient ??= new GatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(GatewayResource.ResourceType)); + private ClientDiagnostics OperatorApiConnectionClientDiagnostics => _operatorApiConnectionClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ProgrammableConnectivity", OperatorApiConnectionResource.ResourceType.Namespace, Diagnostics); + private OperatorApiConnectionsRestOperations OperatorApiConnectionRestClient => _operatorApiConnectionRestClient ??= new OperatorApiConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(OperatorApiConnectionResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of OperatorApiPlanResources in the SubscriptionResource. + /// An object representing collection of OperatorApiPlanResources and their operations over a OperatorApiPlanResource. + public virtual OperatorApiPlanCollection GetOperatorApiPlans() + { + return GetCachedClient(client => new OperatorApiPlanCollection(client, Id)); + } + + /// + /// Get an OperatorApiPlan resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/{operatorApiPlanName} + /// + /// + /// Operation Id + /// OperatorApiPlan_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// APC Gateway Plan Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetOperatorApiPlanAsync(string operatorApiPlanName, CancellationToken cancellationToken = default) + { + return await GetOperatorApiPlans().GetAsync(operatorApiPlanName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an OperatorApiPlan resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/{operatorApiPlanName} + /// + /// + /// Operation Id + /// OperatorApiPlan_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// APC Gateway Plan Name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetOperatorApiPlan(string operatorApiPlanName, CancellationToken cancellationToken = default) + { + return GetOperatorApiPlans().Get(operatorApiPlanName, cancellationToken); + } + + /// + /// List Gateway resources by subscription ID. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/gateways + /// + /// + /// Operation Id + /// Gateway_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetGatewaysAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => GatewayRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GatewayRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GatewayResource(Client, GatewayData.DeserializeGatewayData(e)), GatewayClientDiagnostics, Pipeline, "MockableProgrammableConnectivitySubscriptionResource.GetGateways", "value", "nextLink", cancellationToken); + } + + /// + /// List Gateway resources by subscription ID. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/gateways + /// + /// + /// Operation Id + /// Gateway_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetGateways(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => GatewayRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GatewayRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GatewayResource(Client, GatewayData.DeserializeGatewayData(e)), GatewayClientDiagnostics, Pipeline, "MockableProgrammableConnectivitySubscriptionResource.GetGateways", "value", "nextLink", cancellationToken); + } + + /// + /// List OperatorApiConnection resources by subscription ID. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections + /// + /// + /// Operation Id + /// OperatorApiConnection_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetOperatorApiConnectionsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => OperatorApiConnectionRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperatorApiConnectionRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OperatorApiConnectionResource(Client, OperatorApiConnectionData.DeserializeOperatorApiConnectionData(e)), OperatorApiConnectionClientDiagnostics, Pipeline, "MockableProgrammableConnectivitySubscriptionResource.GetOperatorApiConnections", "value", "nextLink", cancellationToken); + } + + /// + /// List OperatorApiConnection resources by subscription ID. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections + /// + /// + /// Operation Id + /// OperatorApiConnection_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetOperatorApiConnections(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => OperatorApiConnectionRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperatorApiConnectionRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OperatorApiConnectionResource(Client, OperatorApiConnectionData.DeserializeOperatorApiConnectionData(e)), OperatorApiConnectionClientDiagnostics, Pipeline, "MockableProgrammableConnectivitySubscriptionResource.GetOperatorApiConnections", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Extensions/ProgrammableConnectivityExtensions.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Extensions/ProgrammableConnectivityExtensions.cs new file mode 100644 index 000000000000..0d39101eef52 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Extensions/ProgrammableConnectivityExtensions.cs @@ -0,0 +1,515 @@ +// 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.ProgrammableConnectivity.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + /// A class to add extension methods to Azure.ResourceManager.ProgrammableConnectivity. + public static partial class ProgrammableConnectivityExtensions + { + private static MockableProgrammableConnectivityArmClient GetMockableProgrammableConnectivityArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableProgrammableConnectivityArmClient(client0)); + } + + private static MockableProgrammableConnectivityResourceGroupResource GetMockableProgrammableConnectivityResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableProgrammableConnectivityResourceGroupResource(client, resource.Id)); + } + + private static MockableProgrammableConnectivitySubscriptionResource GetMockableProgrammableConnectivitySubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableProgrammableConnectivitySubscriptionResource(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 GatewayResource GetGatewayResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableProgrammableConnectivityArmClient(client).GetGatewayResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its 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 OperatorApiConnectionResource GetOperatorApiConnectionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableProgrammableConnectivityArmClient(client).GetOperatorApiConnectionResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its 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 OperatorApiPlanResource GetOperatorApiPlanResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableProgrammableConnectivityArmClient(client).GetOperatorApiPlanResource(id); + } + + /// + /// Gets a collection of GatewayResources 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 GatewayResources and their operations over a GatewayResource. + public static GatewayCollection GetGateways(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableProgrammableConnectivityResourceGroupResource(resourceGroupResource).GetGateways(); + } + + /// + /// Get a Gateway resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Azure Programmable Connectivity Gateway Name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetGatewayAsync(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableProgrammableConnectivityResourceGroupResource(resourceGroupResource).GetGatewayAsync(gatewayName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Gateway resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Azure Programmable Connectivity Gateway Name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetGateway(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableProgrammableConnectivityResourceGroupResource(resourceGroupResource).GetGateway(gatewayName, cancellationToken); + } + + /// + /// Gets a collection of OperatorApiConnectionResources 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 OperatorApiConnectionResources and their operations over a OperatorApiConnectionResource. + public static OperatorApiConnectionCollection GetOperatorApiConnections(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableProgrammableConnectivityResourceGroupResource(resourceGroupResource).GetOperatorApiConnections(); + } + + /// + /// Get an Operator API Connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetOperatorApiConnectionAsync(this ResourceGroupResource resourceGroupResource, string operatorApiConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableProgrammableConnectivityResourceGroupResource(resourceGroupResource).GetOperatorApiConnectionAsync(operatorApiConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an Operator API Connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetOperatorApiConnection(this ResourceGroupResource resourceGroupResource, string operatorApiConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableProgrammableConnectivityResourceGroupResource(resourceGroupResource).GetOperatorApiConnection(operatorApiConnectionName, cancellationToken); + } + + /// + /// Gets a collection of OperatorApiPlanResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of OperatorApiPlanResources and their operations over a OperatorApiPlanResource. + public static OperatorApiPlanCollection GetOperatorApiPlans(this SubscriptionResource subscriptionResource) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableProgrammableConnectivitySubscriptionResource(subscriptionResource).GetOperatorApiPlans(); + } + + /// + /// Get an OperatorApiPlan resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/{operatorApiPlanName} + /// + /// + /// Operation Id + /// OperatorApiPlan_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// APC Gateway Plan Name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetOperatorApiPlanAsync(this SubscriptionResource subscriptionResource, string operatorApiPlanName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableProgrammableConnectivitySubscriptionResource(subscriptionResource).GetOperatorApiPlanAsync(operatorApiPlanName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get an OperatorApiPlan resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/{operatorApiPlanName} + /// + /// + /// Operation Id + /// OperatorApiPlan_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// APC Gateway Plan Name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetOperatorApiPlan(this SubscriptionResource subscriptionResource, string operatorApiPlanName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableProgrammableConnectivitySubscriptionResource(subscriptionResource).GetOperatorApiPlan(operatorApiPlanName, cancellationToken); + } + + /// + /// List Gateway resources by subscription ID. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/gateways + /// + /// + /// Operation Id + /// Gateway_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-30-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 GetGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableProgrammableConnectivitySubscriptionResource(subscriptionResource).GetGatewaysAsync(cancellationToken); + } + + /// + /// List Gateway resources by subscription ID. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/gateways + /// + /// + /// Operation Id + /// Gateway_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-30-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 GetGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableProgrammableConnectivitySubscriptionResource(subscriptionResource).GetGateways(cancellationToken); + } + + /// + /// List OperatorApiConnection resources by subscription ID. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections + /// + /// + /// Operation Id + /// OperatorApiConnection_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-30-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 GetOperatorApiConnectionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableProgrammableConnectivitySubscriptionResource(subscriptionResource).GetOperatorApiConnectionsAsync(cancellationToken); + } + + /// + /// List OperatorApiConnection resources by subscription ID. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections + /// + /// + /// Operation Id + /// OperatorApiConnection_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-30-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 GetOperatorApiConnections(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableProgrammableConnectivitySubscriptionResource(subscriptionResource).GetOperatorApiConnections(cancellationToken); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/GatewayCollection.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/GatewayCollection.cs new file mode 100644 index 000000000000..a72019c91c3e --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/GatewayCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + /// + /// 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 GetGateways method from an instance of . + /// + public partial class GatewayCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _gatewayClientDiagnostics; + private readonly GatewaysRestOperations _gatewayRestClient; + + /// Initializes a new instance of the class for mocking. + protected GatewayCollection() + { + } + + /// 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 GatewayCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _gatewayClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ProgrammableConnectivity", GatewayResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(GatewayResource.ResourceType, out string gatewayApiVersion); + _gatewayRestClient = new GatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, gatewayApiVersion); +#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 or update an APC Gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-30-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. + /// Azure Programmable Connectivity Gateway Name. + /// 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 gatewayName, GatewayData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _gatewayRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data, cancellationToken).ConfigureAwait(false); + var operation = new ProgrammableConnectivityArmOperation(new GatewayOperationSource(Client), _gatewayClientDiagnostics, Pipeline, _gatewayRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, 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 or update an APC Gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-30-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. + /// Azure Programmable Connectivity Gateway Name. + /// 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 gatewayName, GatewayData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _gatewayRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data, cancellationToken); + var operation = new ProgrammableConnectivityArmOperation(new GatewayOperationSource(Client), _gatewayClientDiagnostics, Pipeline, _gatewayRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Gateway resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity Gateway Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.Get"); + scope.Start(); + try + { + var response = await _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GatewayResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Gateway resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity Gateway Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.Get"); + scope.Start(); + try + { + var response = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GatewayResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Gateway resources by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways + /// + /// + /// Operation Id + /// Gateway_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-30-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) => _gatewayRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _gatewayRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GatewayResource(Client, GatewayData.DeserializeGatewayData(e)), _gatewayClientDiagnostics, Pipeline, "GatewayCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Gateway resources by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways + /// + /// + /// Operation Id + /// Gateway_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-30-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) => _gatewayRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _gatewayRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GatewayResource(Client, GatewayData.DeserializeGatewayData(e)), _gatewayClientDiagnostics, Pipeline, "GatewayCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity Gateway Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.Exists"); + scope.Start(); + try + { + var response = await _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, 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.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity Gateway Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.Exists"); + scope.Start(); + try + { + var response = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, 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.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity Gateway Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GatewayResource(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.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity Gateway Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.GetIfExists"); + scope.Start(); + try + { + var response = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GatewayResource(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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/GatewayData.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/GatewayData.Serialization.cs new file mode 100644 index 000000000000..91afe1b95136 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/GatewayData.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.ProgrammableConnectivity.Models; + +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + public partial class GatewayData : 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(GatewayData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + GatewayData 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(GatewayData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGatewayData(document.RootElement, options); + } + + internal static GatewayData DeserializeGatewayData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + GatewayProperties properties = 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 = GatewayProperties.DeserializeGatewayProperties(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GatewayData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(GatewayData)} does not support writing '{options.Format}' format."); + } + } + + GatewayData 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 DeserializeGatewayData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GatewayData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/GatewayData.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/GatewayData.cs new file mode 100644 index 000000000000..9912e806808b --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/GatewayData.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.ProgrammableConnectivity.Models; + +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + /// + /// A class representing the Gateway data model. + /// A Programmable Connectivity Gateway resource. + /// + public partial class GatewayData : 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 GatewayData(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. + /// Keeps track of any properties unknown to the library. + internal GatewayData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, GatewayProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GatewayData() + { + } + + /// The resource-specific properties for this resource. + public GatewayProperties Properties { get; set; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/GatewayResource.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/GatewayResource.Serialization.cs new file mode 100644 index 000000000000..a63a6d72d7ec --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/GatewayResource.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.ProgrammableConnectivity +{ + public partial class GatewayResource : IJsonModel + { + private static GatewayData s_dataDeserializationInstance; + private static GatewayData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + GatewayData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerProgrammableConnectivityContext.Default); + + GatewayData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerProgrammableConnectivityContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/GatewayResource.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/GatewayResource.cs new file mode 100644 index 000000000000..0d9e26b08740 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/GatewayResource.cs @@ -0,0 +1,699 @@ +// 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.ProgrammableConnectivity.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + /// + /// A Class representing a Gateway 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 GetGatewayResource method. + /// Otherwise you can get one from its parent resource using the GetGateway method. + /// + public partial class GatewayResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The gatewayName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string gatewayName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _gatewayClientDiagnostics; + private readonly GatewaysRestOperations _gatewayRestClient; + private readonly GatewayData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ProgrammableConnectivity/gateways"; + + /// Initializes a new instance of the class for mocking. + protected GatewayResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal GatewayResource(ArmClient client, GatewayData 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 GatewayResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _gatewayClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ProgrammableConnectivity", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string gatewayApiVersion); + _gatewayRestClient = new GatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, gatewayApiVersion); +#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 GatewayData 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 Gateway resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayResource.Get"); + scope.Start(); + try + { + var response = await _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GatewayResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Gateway resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayResource.Get"); + scope.Start(); + try + { + var response = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GatewayResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Delete + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.Delete"); + scope.Start(); + try + { + var response = await _gatewayRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ProgrammableConnectivityArmOperation(_gatewayClientDiagnostics, Pipeline, _gatewayRestClient.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 Gateway. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Delete + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.Delete"); + scope.Start(); + try + { + var response = _gatewayRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ProgrammableConnectivityArmOperation(_gatewayClientDiagnostics, Pipeline, _gatewayRestClient.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 Gateway tags. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Update + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(GatewayPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayResource.Update"); + scope.Start(); + try + { + var response = await _gatewayRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new GatewayResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Gateway tags. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Update + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual Response Update(GatewayPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayResource.Update"); + scope.Start(); + try + { + var response = _gatewayRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + return Response.FromValue(new GatewayResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.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 _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new GatewayPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.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 = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new GatewayPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + 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.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.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 _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new GatewayPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + 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.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.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 = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new GatewayPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.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 _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new GatewayPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/gateways/{gatewayName} + /// + /// + /// Operation Id + /// Gateway_Get + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.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 = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new GatewayPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Internal/Argument.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..beda91d69376 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/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.ProgrammableConnectivity +{ + 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..1afce6114233 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/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.ProgrammableConnectivity +{ + 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Internal/ChangeTrackingList.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..27db7f07e05a --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/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.ProgrammableConnectivity +{ + 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..1568d0d5f79f --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,407 @@ +// 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.ProgrammableConnectivity +{ + 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()); + + 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 bool IsSentinelValue(BinaryData value) + { + ReadOnlySpan sentinelSpan = SentinelValue.ToMemory().Span; + ReadOnlySpan valueSpan = value.ToMemory().Span; + return sentinelSpan.SequenceEqual(valueSpan); + } + + 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Internal/Optional.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..cfc9dc8eb357 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/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.ProgrammableConnectivity +{ + 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..851bc19bbea7 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/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.ProgrammableConnectivity +{ + 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/LongRunningOperation/GatewayOperationSource.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/LongRunningOperation/GatewayOperationSource.cs new file mode 100644 index 000000000000..c4d4a73ad600 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/LongRunningOperation/GatewayOperationSource.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.ProgrammableConnectivity +{ + internal class GatewayOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal GatewayOperationSource(ArmClient client) + { + _client = client; + } + + GatewayResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerProgrammableConnectivityContext.Default); + return new GatewayResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerProgrammableConnectivityContext.Default); + return await Task.FromResult(new GatewayResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/LongRunningOperation/OperatorApiConnectionOperationSource.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/LongRunningOperation/OperatorApiConnectionOperationSource.cs new file mode 100644 index 000000000000..aae73f53f034 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/LongRunningOperation/OperatorApiConnectionOperationSource.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.ProgrammableConnectivity +{ + internal class OperatorApiConnectionOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal OperatorApiConnectionOperationSource(ArmClient client) + { + _client = client; + } + + OperatorApiConnectionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerProgrammableConnectivityContext.Default); + return new OperatorApiConnectionResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerProgrammableConnectivityContext.Default); + return await Task.FromResult(new OperatorApiConnectionResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/LongRunningOperation/ProgrammableConnectivityArmOperation.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/LongRunningOperation/ProgrammableConnectivityArmOperation.cs new file mode 100644 index 000000000000..5180a45b2295 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/LongRunningOperation/ProgrammableConnectivityArmOperation.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.ProgrammableConnectivity +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ProgrammableConnectivityArmOperation : 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 ProgrammableConnectivityArmOperation for mocking. + protected ProgrammableConnectivityArmOperation() + { + } + + internal ProgrammableConnectivityArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ProgrammableConnectivityArmOperation(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, "ProgrammableConnectivityArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerProgrammableConnectivityContext.Default).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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/LongRunningOperation/ProgrammableConnectivityArmOperationOfT.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/LongRunningOperation/ProgrammableConnectivityArmOperationOfT.cs new file mode 100644 index 000000000000..31b5d19389f6 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/LongRunningOperation/ProgrammableConnectivityArmOperationOfT.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.ProgrammableConnectivity +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ProgrammableConnectivityArmOperation : 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 ProgrammableConnectivityArmOperation for mocking. + protected ProgrammableConnectivityArmOperation() + { + } + + internal ProgrammableConnectivityArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ProgrammableConnectivityArmOperation(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, "ProgrammableConnectivityArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerProgrammableConnectivityContext.Default).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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ApplicationOwnerProperties.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ApplicationOwnerProperties.Serialization.cs new file mode 100644 index 000000000000..e1e6ac37d404 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ApplicationOwnerProperties.Serialization.cs @@ -0,0 +1,273 @@ +// 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.ProgrammableConnectivity.Models +{ + public partial class ApplicationOwnerProperties : 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(ApplicationOwnerProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("legalName"u8); + writer.WriteStringValue(LegalName); + writer.WritePropertyName("tradingName"u8); + writer.WriteStringValue(TradingName); + writer.WritePropertyName("organizationDescription"u8); + writer.WriteStringValue(OrganizationDescription); + writer.WritePropertyName("taxNumber"u8); + writer.WriteStringValue(TaxNumber); + writer.WritePropertyName("organizationType"u8); + writer.WriteStringValue(OrganizationType.ToString()); + writer.WritePropertyName("organizationIdentificationId"u8); + writer.WriteStringValue(OrganizationIdentificationId); + writer.WritePropertyName("organizationIdentificationIssuer"u8); + writer.WriteStringValue(OrganizationIdentificationIssuer); + writer.WritePropertyName("organizationIdentificationType"u8); + writer.WriteStringValue(OrganizationIdentificationType); + writer.WritePropertyName("contactEmailAddress"u8); + writer.WriteStringValue(ContactEmailAddress); + writer.WritePropertyName("legalRepresentative"u8); + writer.WriteObjectValue(LegalRepresentative, options); + writer.WritePropertyName("privacyManager"u8); + writer.WriteObjectValue(PrivacyManager, options); + writer.WritePropertyName("dataProtectionOfficer"u8); + writer.WriteObjectValue(DataProtectionOfficer, options); + writer.WritePropertyName("registeredGeographicAddress"u8); + writer.WriteObjectValue(RegisteredGeographicAddress, options); + writer.WritePropertyName("privacyPolicyUrl"u8); + writer.WriteStringValue(PrivacyPolicyUri.AbsoluteUri); + writer.WritePropertyName("localRepresentatives"u8); + writer.WriteStartArray(); + foreach (var item in LocalRepresentatives) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ApplicationOwnerProperties 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(ApplicationOwnerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApplicationOwnerProperties(document.RootElement, options); + } + + internal static ApplicationOwnerProperties DeserializeApplicationOwnerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string legalName = default; + string tradingName = default; + string organizationDescription = default; + string taxNumber = default; + OrganizationType organizationType = default; + string organizationIdentificationId = default; + string organizationIdentificationIssuer = default; + string organizationIdentificationType = default; + string contactEmailAddress = default; + Person legalRepresentative = default; + Person privacyManager = default; + Person dataProtectionOfficer = default; + GeographicAddress registeredGeographicAddress = default; + Uri privacyPolicyUrl = default; + IList localRepresentatives = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("legalName"u8)) + { + legalName = property.Value.GetString(); + continue; + } + if (property.NameEquals("tradingName"u8)) + { + tradingName = property.Value.GetString(); + continue; + } + if (property.NameEquals("organizationDescription"u8)) + { + organizationDescription = property.Value.GetString(); + continue; + } + if (property.NameEquals("taxNumber"u8)) + { + taxNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("organizationType"u8)) + { + organizationType = new OrganizationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("organizationIdentificationId"u8)) + { + organizationIdentificationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("organizationIdentificationIssuer"u8)) + { + organizationIdentificationIssuer = property.Value.GetString(); + continue; + } + if (property.NameEquals("organizationIdentificationType"u8)) + { + organizationIdentificationType = property.Value.GetString(); + continue; + } + if (property.NameEquals("contactEmailAddress"u8)) + { + contactEmailAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("legalRepresentative"u8)) + { + legalRepresentative = Person.DeserializePerson(property.Value, options); + continue; + } + if (property.NameEquals("privacyManager"u8)) + { + privacyManager = Person.DeserializePerson(property.Value, options); + continue; + } + if (property.NameEquals("dataProtectionOfficer"u8)) + { + dataProtectionOfficer = Person.DeserializePerson(property.Value, options); + continue; + } + if (property.NameEquals("registeredGeographicAddress"u8)) + { + registeredGeographicAddress = GeographicAddress.DeserializeGeographicAddress(property.Value, options); + continue; + } + if (property.NameEquals("privacyPolicyUrl"u8)) + { + privacyPolicyUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("localRepresentatives"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(LocalRepresentative.DeserializeLocalRepresentative(item, options)); + } + localRepresentatives = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ApplicationOwnerProperties( + name, + legalName, + tradingName, + organizationDescription, + taxNumber, + organizationType, + organizationIdentificationId, + organizationIdentificationIssuer, + organizationIdentificationType, + contactEmailAddress, + legalRepresentative, + privacyManager, + dataProtectionOfficer, + registeredGeographicAddress, + privacyPolicyUrl, + localRepresentatives, + 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, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(ApplicationOwnerProperties)} does not support writing '{options.Format}' format."); + } + } + + ApplicationOwnerProperties 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 DeserializeApplicationOwnerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApplicationOwnerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ApplicationOwnerProperties.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ApplicationOwnerProperties.cs new file mode 100644 index 000000000000..3b8004417b61 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ApplicationOwnerProperties.cs @@ -0,0 +1,180 @@ +// 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.ProgrammableConnectivity.Models +{ + /// Details about the Application Owner (i.e. organization) that would use the Operator's Network APIs. + public partial class ApplicationOwnerProperties + { + /// + /// 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 . + /// Common name of the organization owning the application. + /// Legal name of the organization owning the application. + /// Trading name of the organization owning the application. + /// A description of the organization owning the application. + /// Unique Tax Number for the user's organization in the country/region the APC Gateway is being purchased. + /// The type of organization that the Application Owner is. + /// ID number for official identification of the organization. + /// Issuing organization of the ID for official identification of the organization. + /// Type of official identification of the organization. + /// Email address for the person responsible for the use of Network APIs in this application. + /// Legal representative of the organization. + /// Privacy manager of the organization. + /// Data Protection Officer of the organization. + /// Registered Geographic address. + /// URL for the organization's privacy policy. + /// List of local representatives. + /// , , , , , , , , , , , , , or is null. + public ApplicationOwnerProperties(string name, string legalName, string tradingName, string organizationDescription, string taxNumber, OrganizationType organizationType, string organizationIdentificationId, string organizationIdentificationIssuer, string organizationIdentificationType, string contactEmailAddress, Person legalRepresentative, Person privacyManager, Person dataProtectionOfficer, GeographicAddress registeredGeographicAddress, Uri privacyPolicyUri, IEnumerable localRepresentatives) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(legalName, nameof(legalName)); + Argument.AssertNotNull(tradingName, nameof(tradingName)); + Argument.AssertNotNull(organizationDescription, nameof(organizationDescription)); + Argument.AssertNotNull(taxNumber, nameof(taxNumber)); + Argument.AssertNotNull(organizationIdentificationId, nameof(organizationIdentificationId)); + Argument.AssertNotNull(organizationIdentificationIssuer, nameof(organizationIdentificationIssuer)); + Argument.AssertNotNull(organizationIdentificationType, nameof(organizationIdentificationType)); + Argument.AssertNotNull(contactEmailAddress, nameof(contactEmailAddress)); + Argument.AssertNotNull(legalRepresentative, nameof(legalRepresentative)); + Argument.AssertNotNull(privacyManager, nameof(privacyManager)); + Argument.AssertNotNull(dataProtectionOfficer, nameof(dataProtectionOfficer)); + Argument.AssertNotNull(registeredGeographicAddress, nameof(registeredGeographicAddress)); + Argument.AssertNotNull(privacyPolicyUri, nameof(privacyPolicyUri)); + Argument.AssertNotNull(localRepresentatives, nameof(localRepresentatives)); + + Name = name; + LegalName = legalName; + TradingName = tradingName; + OrganizationDescription = organizationDescription; + TaxNumber = taxNumber; + OrganizationType = organizationType; + OrganizationIdentificationId = organizationIdentificationId; + OrganizationIdentificationIssuer = organizationIdentificationIssuer; + OrganizationIdentificationType = organizationIdentificationType; + ContactEmailAddress = contactEmailAddress; + LegalRepresentative = legalRepresentative; + PrivacyManager = privacyManager; + DataProtectionOfficer = dataProtectionOfficer; + RegisteredGeographicAddress = registeredGeographicAddress; + PrivacyPolicyUri = privacyPolicyUri; + LocalRepresentatives = localRepresentatives.ToList(); + } + + /// Initializes a new instance of . + /// Common name of the organization owning the application. + /// Legal name of the organization owning the application. + /// Trading name of the organization owning the application. + /// A description of the organization owning the application. + /// Unique Tax Number for the user's organization in the country/region the APC Gateway is being purchased. + /// The type of organization that the Application Owner is. + /// ID number for official identification of the organization. + /// Issuing organization of the ID for official identification of the organization. + /// Type of official identification of the organization. + /// Email address for the person responsible for the use of Network APIs in this application. + /// Legal representative of the organization. + /// Privacy manager of the organization. + /// Data Protection Officer of the organization. + /// Registered Geographic address. + /// URL for the organization's privacy policy. + /// List of local representatives. + /// Keeps track of any properties unknown to the library. + internal ApplicationOwnerProperties(string name, string legalName, string tradingName, string organizationDescription, string taxNumber, OrganizationType organizationType, string organizationIdentificationId, string organizationIdentificationIssuer, string organizationIdentificationType, string contactEmailAddress, Person legalRepresentative, Person privacyManager, Person dataProtectionOfficer, GeographicAddress registeredGeographicAddress, Uri privacyPolicyUri, IList localRepresentatives, IDictionary serializedAdditionalRawData) + { + Name = name; + LegalName = legalName; + TradingName = tradingName; + OrganizationDescription = organizationDescription; + TaxNumber = taxNumber; + OrganizationType = organizationType; + OrganizationIdentificationId = organizationIdentificationId; + OrganizationIdentificationIssuer = organizationIdentificationIssuer; + OrganizationIdentificationType = organizationIdentificationType; + ContactEmailAddress = contactEmailAddress; + LegalRepresentative = legalRepresentative; + PrivacyManager = privacyManager; + DataProtectionOfficer = dataProtectionOfficer; + RegisteredGeographicAddress = registeredGeographicAddress; + PrivacyPolicyUri = privacyPolicyUri; + LocalRepresentatives = localRepresentatives; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ApplicationOwnerProperties() + { + } + + /// Common name of the organization owning the application. + public string Name { get; set; } + /// Legal name of the organization owning the application. + public string LegalName { get; set; } + /// Trading name of the organization owning the application. + public string TradingName { get; set; } + /// A description of the organization owning the application. + public string OrganizationDescription { get; set; } + /// Unique Tax Number for the user's organization in the country/region the APC Gateway is being purchased. + public string TaxNumber { get; set; } + /// The type of organization that the Application Owner is. + public OrganizationType OrganizationType { get; set; } + /// ID number for official identification of the organization. + public string OrganizationIdentificationId { get; set; } + /// Issuing organization of the ID for official identification of the organization. + public string OrganizationIdentificationIssuer { get; set; } + /// Type of official identification of the organization. + public string OrganizationIdentificationType { get; set; } + /// Email address for the person responsible for the use of Network APIs in this application. + public string ContactEmailAddress { get; set; } + /// Legal representative of the organization. + public Person LegalRepresentative { get; set; } + /// Privacy manager of the organization. + public Person PrivacyManager { get; set; } + /// Data Protection Officer of the organization. + public Person DataProtectionOfficer { get; set; } + /// Registered Geographic address. + public GeographicAddress RegisteredGeographicAddress { get; set; } + /// URL for the organization's privacy policy. + public Uri PrivacyPolicyUri { get; set; } + /// List of local representatives. + public IList LocalRepresentatives { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ApplicationProperties.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ApplicationProperties.Serialization.cs new file mode 100644 index 000000000000..ace984b1998d --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ApplicationProperties.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + public partial class ApplicationProperties : 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(ApplicationProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("applicationDescription"u8); + writer.WriteStringValue(ApplicationDescription); + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category.ToString()); + writer.WritePropertyName("commercialName"u8); + writer.WriteStringValue(CommercialName); + writer.WritePropertyName("privacyRightsRequestEmailAddress"u8); + writer.WriteStringValue(PrivacyRightsRequestEmailAddress); + writer.WritePropertyName("privacyPolicyUrl"u8); + writer.WriteStringValue(PrivacyPolicyUri.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 + } + } + } + + ApplicationProperties 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(ApplicationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApplicationProperties(document.RootElement, options); + } + + internal static ApplicationProperties DeserializeApplicationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string applicationDescription = default; + Category category = default; + string commercialName = default; + string privacyRightsRequestEmailAddress = default; + Uri privacyPolicyUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("applicationDescription"u8)) + { + applicationDescription = property.Value.GetString(); + continue; + } + if (property.NameEquals("category"u8)) + { + category = new Category(property.Value.GetString()); + continue; + } + if (property.NameEquals("commercialName"u8)) + { + commercialName = property.Value.GetString(); + continue; + } + if (property.NameEquals("privacyRightsRequestEmailAddress"u8)) + { + privacyRightsRequestEmailAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("privacyPolicyUrl"u8)) + { + privacyPolicyUrl = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ApplicationProperties( + name, + applicationDescription, + category, + commercialName, + privacyRightsRequestEmailAddress, + privacyPolicyUrl, + 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, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(ApplicationProperties)} does not support writing '{options.Format}' format."); + } + } + + ApplicationProperties 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 DeserializeApplicationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApplicationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ApplicationProperties.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ApplicationProperties.cs new file mode 100644 index 000000000000..c29e38dcddae --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ApplicationProperties.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Details about the Application that would use the Operator's Network APIs. + public partial class ApplicationProperties + { + /// + /// 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 . + /// Name of the application. + /// Description of the application. + /// The category of the application. + /// Commercial name of the application. + /// Privacy rights request email address. + /// URL for the organization's privacy policy. + /// , , , or is null. + public ApplicationProperties(string name, string applicationDescription, Category category, string commercialName, string privacyRightsRequestEmailAddress, Uri privacyPolicyUri) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(applicationDescription, nameof(applicationDescription)); + Argument.AssertNotNull(commercialName, nameof(commercialName)); + Argument.AssertNotNull(privacyRightsRequestEmailAddress, nameof(privacyRightsRequestEmailAddress)); + Argument.AssertNotNull(privacyPolicyUri, nameof(privacyPolicyUri)); + + Name = name; + ApplicationDescription = applicationDescription; + Category = category; + CommercialName = commercialName; + PrivacyRightsRequestEmailAddress = privacyRightsRequestEmailAddress; + PrivacyPolicyUri = privacyPolicyUri; + } + + /// Initializes a new instance of . + /// Name of the application. + /// Description of the application. + /// The category of the application. + /// Commercial name of the application. + /// Privacy rights request email address. + /// URL for the organization's privacy policy. + /// Keeps track of any properties unknown to the library. + internal ApplicationProperties(string name, string applicationDescription, Category category, string commercialName, string privacyRightsRequestEmailAddress, Uri privacyPolicyUri, IDictionary serializedAdditionalRawData) + { + Name = name; + ApplicationDescription = applicationDescription; + Category = category; + CommercialName = commercialName; + PrivacyRightsRequestEmailAddress = privacyRightsRequestEmailAddress; + PrivacyPolicyUri = privacyPolicyUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ApplicationProperties() + { + } + + /// Name of the application. + public string Name { get; set; } + /// Description of the application. + public string ApplicationDescription { get; set; } + /// The category of the application. + public Category Category { get; set; } + /// Commercial name of the application. + public string CommercialName { get; set; } + /// Privacy rights request email address. + public string PrivacyRightsRequestEmailAddress { get; set; } + /// URL for the organization's privacy policy. + public Uri PrivacyPolicyUri { get; set; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/AzureResourceManagerProgrammableConnectivityContext.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/AzureResourceManagerProgrammableConnectivityContext.cs new file mode 100644 index 000000000000..5cfc08b41e62 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/AzureResourceManagerProgrammableConnectivityContext.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.ProgrammableConnectivity +{ + /// + /// 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 AzureResourceManagerProgrammableConnectivityContext : ModelReaderWriterContext + { + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Category.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Category.cs new file mode 100644 index 000000000000..60ce268586db --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Category.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Valid values for category based on https://www.tmforum.org/oda/open-apis/directory/open-gateway-onboarding-and-ordering-component-suite-TMF931. + public readonly partial struct Category : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Category(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AgricultureValue = "Agriculture"; + private const string ArtAndDesignValue = "Art and design"; + private const string AutoAndVehicleValue = "Auto and vehicle"; + private const string BeautyValue = "Beauty"; + private const string BooksAndReferenceValue = "Books and reference"; + private const string BusinessValue = "Business"; + private const string ConstructionValue = "Construction"; + private const string DefenseValue = "Defense"; + private const string DeveloperToolsValue = "Developer tools"; + private const string EducationValue = "Education"; + private const string EngineeringValue = "Engineering"; + private const string EventsAndEntertainmentValue = "Events and entertainment"; + private const string FinanceValue = "Finance"; + private const string FoodAndDrinkValue = "Food and drink"; + private const string GamesValue = "Games"; + private const string HealthAndFitnessValue = "Health and fitness"; + private const string HealthcareValue = "Healthcare"; + private const string InformationValue = "Information"; + private const string KidsValue = "Kids"; + private const string LibrariesAndDemoValue = "Libraries and demo"; + private const string LifestyleValue = "Lifestyle"; + private const string ManufacturingValue = "Manufacturing"; + private const string MapsAndNavigationValue = "Maps and navigation"; + private const string MediaValue = "Media"; + private const string MedicalValue = "Medical"; + private const string MiningValue = "Mining"; + private const string MusicAndAudioValue = "Music and audio"; + private const string NewsAndMagazinesValue = "News and magazines"; + private const string OrganizationsValue = "Organizations"; + private const string OtherValue = "Other"; + private const string PhotoAndVideoValue = "Photo and video"; + private const string ProductivityValue = "Productivity"; + private const string PublicServiceValue = "Public service"; + private const string RealEstateValue = "Real estate"; + private const string ShoppingValue = "Shopping"; + private const string SocialNetworkingAndCommunicationsValue = "Social networking and communications"; + private const string SportsValue = "Sports"; + private const string TourismValue = "Tourism"; + private const string UtilitiesValue = "Utilities"; + private const string TradingValue = "Trading"; + private const string TransportationValue = "Transportation"; + private const string TravelAndLocalValue = "Travel and local"; + private const string WaterValue = "Water"; + private const string WeatherValue = "Weather"; + + /// Agriculture. + public static Category Agriculture { get; } = new Category(AgricultureValue); + /// Art and design. + public static Category ArtAndDesign { get; } = new Category(ArtAndDesignValue); + /// Auto and vehicle. + public static Category AutoAndVehicle { get; } = new Category(AutoAndVehicleValue); + /// Beauty. + public static Category Beauty { get; } = new Category(BeautyValue); + /// Books and reference. + public static Category BooksAndReference { get; } = new Category(BooksAndReferenceValue); + /// Business. + public static Category Business { get; } = new Category(BusinessValue); + /// Construction. + public static Category Construction { get; } = new Category(ConstructionValue); + /// Defense. + public static Category Defense { get; } = new Category(DefenseValue); + /// Developer tools. + public static Category DeveloperTools { get; } = new Category(DeveloperToolsValue); + /// Education. + public static Category Education { get; } = new Category(EducationValue); + /// Engineering. + public static Category Engineering { get; } = new Category(EngineeringValue); + /// Events and entertainment. + public static Category EventsAndEntertainment { get; } = new Category(EventsAndEntertainmentValue); + /// Finance. + public static Category Finance { get; } = new Category(FinanceValue); + /// Food and drink. + public static Category FoodAndDrink { get; } = new Category(FoodAndDrinkValue); + /// Games. + public static Category Games { get; } = new Category(GamesValue); + /// Health and fitness. + public static Category HealthAndFitness { get; } = new Category(HealthAndFitnessValue); + /// Healthcare. + public static Category Healthcare { get; } = new Category(HealthcareValue); + /// Information. + public static Category Information { get; } = new Category(InformationValue); + /// Kids. + public static Category Kids { get; } = new Category(KidsValue); + /// Libraries and demo. + public static Category LibrariesAndDemo { get; } = new Category(LibrariesAndDemoValue); + /// Lifestyle. + public static Category Lifestyle { get; } = new Category(LifestyleValue); + /// Manufacturing. + public static Category Manufacturing { get; } = new Category(ManufacturingValue); + /// Maps and navigation. + public static Category MapsAndNavigation { get; } = new Category(MapsAndNavigationValue); + /// Media. + public static Category Media { get; } = new Category(MediaValue); + /// Medical. + public static Category Medical { get; } = new Category(MedicalValue); + /// Mining. + public static Category Mining { get; } = new Category(MiningValue); + /// Music and audio. + public static Category MusicAndAudio { get; } = new Category(MusicAndAudioValue); + /// News and magazines. + public static Category NewsAndMagazines { get; } = new Category(NewsAndMagazinesValue); + /// Organizations. + public static Category Organizations { get; } = new Category(OrganizationsValue); + /// Other. + public static Category Other { get; } = new Category(OtherValue); + /// Photo and video. + public static Category PhotoAndVideo { get; } = new Category(PhotoAndVideoValue); + /// Productivity. + public static Category Productivity { get; } = new Category(ProductivityValue); + /// Public service. + public static Category PublicService { get; } = new Category(PublicServiceValue); + /// Real estate. + public static Category RealEstate { get; } = new Category(RealEstateValue); + /// Shopping. + public static Category Shopping { get; } = new Category(ShoppingValue); + /// Social networking and communications. + public static Category SocialNetworkingAndCommunications { get; } = new Category(SocialNetworkingAndCommunicationsValue); + /// Sports. + public static Category Sports { get; } = new Category(SportsValue); + /// Tourism. + public static Category Tourism { get; } = new Category(TourismValue); + /// Utilities. + public static Category Utilities { get; } = new Category(UtilitiesValue); + /// Trading. + public static Category Trading { get; } = new Category(TradingValue); + /// Transportation. + public static Category Transportation { get; } = new Category(TransportationValue); + /// Travel and local. + public static Category TravelAndLocal { get; } = new Category(TravelAndLocalValue); + /// Water. + public static Category Water { get; } = new Category(WaterValue); + /// Weather. + public static Category Weather { get; } = new Category(WeatherValue); + /// Determines if two values are the same. + public static bool operator ==(Category left, Category right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Category left, Category right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Category(string value) => new Category(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Category other && Equals(other); + /// + public bool Equals(Category 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Context.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Context.cs new file mode 100644 index 000000000000..dc52b3feb3fc --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Context.cs @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Valid values for the context based on W3C Data Privacy Vocabulary v2 https://w3c.github.io/dpv/2.0/dpv/. + public readonly partial struct Context : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Context(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AlgorithmicLogicValue = "Algorithmic logic"; + private const string AssistiveAutomationValue = "Assistive automation"; + private const string AutomatedDecisionMakingValue = "Automated decision making"; + private const string AutomatedScoringOfIndividualsValue = "Automated scoring of individuals"; + private const string AutomationLevelValue = "Automation level"; + private const string AutonomousValue = "Autonomous"; + private const string CannotChallengeProcessValue = "Cannot challenge process"; + private const string CannotChallengeProcessInputValue = "Cannot challenge process input"; + private const string CannotChallengeProcessOutputValue = "Cannot challenge process output"; + private const string CannotCorrectProcessValue = "Cannot correct process"; + private const string CannotCorrectProcessInputValue = "Cannot correct process input"; + private const string CannotCorrectProcessOutputValue = "Cannot correct process output"; + private const string CannotObjectToProcessValue = "Cannot object to process"; + private const string CannotOptInToProcessValue = "Cannot opt in to process"; + private const string CannotOptOutFromProcessValue = "Cannot opt out from process"; + private const string CannotReverseProcessEffectsValue = "Cannot reverse process effects"; + private const string CannotReverseProcessInputValue = "Cannot reverse process input"; + private const string CannotReverseProcessOutputValue = "Cannot reverse process output"; + private const string CannotWithdrawFromProcessValue = "Cannot withdraw from process"; + private const string ChallengingProcessValue = "Challenging process"; + private const string ChallengingProcessInputValue = "Challenging process input"; + private const string ChallengingProcessOutputValue = "Challenging process output"; + private const string ConditionalAutomationValue = "Conditional automation"; + private const string ConsentControlValue = "Consent control"; + private const string CorrectingProcessValue = "Correcting process"; + private const string CorrectingProcessInputValue = "Correcting process input"; + private const string CorrectingProcessOutputValue = "Correcting process output"; + private const string CompletelyManualProcessingValue = "Completely manual processing"; + private const string DataControllerDataSourceValue = "Data controller data source"; + private const string DataPublishedByDataSubjectValue = "Data published by data subject"; + private const string DataSourceValue = "Data source"; + private const string DataSubjectValue = "Data subject"; + private const string DataSubjectDataSourceValue = "Data subject data source"; + private const string DataSubjectScaleValue = "Data subject scale"; + private const string DataVolumeValue = "Data volume"; + private const string DecisionMakingValue = "Decision making"; + private const string EntityActiveInvolvementValue = "Entity active involvement"; + private const string EntityInvolvementValue = "Entity involvement"; + private const string EntityNonInvolvementValue = "Entity non involvement"; + private const string EntityNonPermissiveInvolvementValue = "Entity non permissive involvement"; + private const string EntityPassiveInvolvementValue = "Entity passive involvement"; + private const string EntityPermissiveInvolvementValue = "Entity permissive involvement"; + private const string EvaluationOfIndividualsValue = "Evaluation of individuals"; + private const string EvaluationScoringValue = "Evaluation scoring"; + private const string FullAutomationValue = "Full automation"; + private const string GeographicCoverageValue = "Geographic coverage"; + private const string GlobalScaleValue = "Global scale"; + private const string HighAutomationValue = "High automation"; + private const string HugeDataVolumeValue = "Huge data volume"; + private const string HugeScaleOfDataSubjectsValue = "Huge scale of data subjects"; + private const string HumanInvolvedValue = "Human involved"; + private const string HumanInvolvementValue = "Human involvement"; + private const string HumanInvolvementForControlValue = "Human involvement for control"; + private const string HumanInvolvementForDecisionValue = "Human involvement for decision"; + private const string HumanInvolvementForInputValue = "Human involvement for input"; + private const string HumanInvolvementForInterventionValue = "Human involvement for intervention"; + private const string HumanInvolvementForOversightValue = "Human involvement for oversight"; + private const string HumanInvolvementForVerificationValue = "Human involvement for verification"; + private const string HumanNotInvolvedValue = "Human not involved"; + private const string InnovativeUseOfExistingTechnologyValue = "Innovative use of existing technology"; + private const string InnovativeUseOfNewTechnologiesValue = "Innovative use of new technologies"; + private const string InnovativeUseOfTechnologyValue = "Innovative use of technology"; + private const string LargeDataVolumeValue = "Large data volume"; + private const string LargeScaleOfDataSubjectsValue = "Large scale of data subjects"; + private const string LargeScaleProcessingValue = "Large scale processing"; + private const string LocalEnvironmentScaleValue = "Local environment scale"; + private const string LocalityScaleValue = "Locality scale"; + private const string MediumDataVolumeValue = "Medium data volume"; + private const string MediumScaleOfDataSubjectsValue = "Medium scale of data subjects"; + private const string MediumScaleProcessingValue = "Medium scale processing"; + private const string MultiNationalScaleValue = "Multi national scale"; + private const string NationalScaleValue = "National scale"; + private const string NearlyGlobalScaleValue = "Nearly global scale"; + private const string NonPublicDataSourceValue = "Non public data source"; + private const string NotAutomatedValue = "Not automated"; + private const string ObjectingToProcessValue = "Objecting to process"; + private const string ObtainConsentValue = "Obtain consent"; + private const string OptingInToProcessValue = "Opting in to process"; + private const string OptingOutFromProcessValue = "Opting out from process"; + private const string PartialAutomationValue = "Partial automation"; + private const string ProcessingConditionValue = "Processing condition"; + private const string ProcessingDurationValue = "Processing duration"; + private const string ProcessingLocationValue = "Processing location"; + private const string ProcessingScaleValue = "Processing scale"; + private const string ProvideConsentValue = "Provide consent"; + private const string PublicDataSourceValue = "Public data source"; + private const string ReaffirmConsentValue = "Reaffirm consent"; + private const string RegionalScaleValue = "Regional scale"; + private const string ReversingProcessEffectsValue = "Reversing process effects"; + private const string ReversingProcessInputValue = "Reversing process input"; + private const string ReversingProcessOutputValue = "Reversing process output"; + private const string ScaleValue = "Scale"; + private const string ScoringOfIndividualsValue = "Scoring of individuals"; + private const string SingularDataVolumeValue = "Singular data volume"; + private const string SingularScaleOfDataSubjectsValue = "Singular scale of data subjects"; + private const string SmallDataVolumeValue = "Small data volume"; + private const string SmallScaleOfDataSubjectsValue = "Small scale of data subjects"; + private const string SmallScaleProcessingValue = "Small scale processing"; + private const string SporadicDataVolumeValue = "Sporadic data volume"; + private const string SporadicScaleOfDataSubjectsValue = "Sporadic scale of data subjects"; + private const string StorageConditionValue = "Storage condition"; + private const string StorageDeletionValue = "Storage deletion"; + private const string StorageDurationValue = "Storage duration"; + private const string StorageLocationValue = "Storage location"; + private const string StorageRestorationValue = "Storage restoration"; + private const string SystematicMonitoringValue = "Systematic monitoring"; + private const string ThirdPartyDataSourceValue = "Third party data source"; + private const string WithdrawConsentValue = "Withdraw consent"; + private const string WithdrawingFromProcessValue = "Withdrawing from process"; + + /// Algorithmic logic. + public static Context AlgorithmicLogic { get; } = new Context(AlgorithmicLogicValue); + /// Assistive automation. + public static Context AssistiveAutomation { get; } = new Context(AssistiveAutomationValue); + /// Automated decision making. + public static Context AutomatedDecisionMaking { get; } = new Context(AutomatedDecisionMakingValue); + /// Automated scoring of individuals. + public static Context AutomatedScoringOfIndividuals { get; } = new Context(AutomatedScoringOfIndividualsValue); + /// Automation level. + public static Context AutomationLevel { get; } = new Context(AutomationLevelValue); + /// Autonomous. + public static Context Autonomous { get; } = new Context(AutonomousValue); + /// Cannot challenge process. + public static Context CannotChallengeProcess { get; } = new Context(CannotChallengeProcessValue); + /// Cannot challenge process input. + public static Context CannotChallengeProcessInput { get; } = new Context(CannotChallengeProcessInputValue); + /// Cannot challenge process output. + public static Context CannotChallengeProcessOutput { get; } = new Context(CannotChallengeProcessOutputValue); + /// Cannot correct process. + public static Context CannotCorrectProcess { get; } = new Context(CannotCorrectProcessValue); + /// Cannot correct process input. + public static Context CannotCorrectProcessInput { get; } = new Context(CannotCorrectProcessInputValue); + /// Cannot correct process output. + public static Context CannotCorrectProcessOutput { get; } = new Context(CannotCorrectProcessOutputValue); + /// Cannot object to process. + public static Context CannotObjectToProcess { get; } = new Context(CannotObjectToProcessValue); + /// Cannot opt in to process. + public static Context CannotOptInToProcess { get; } = new Context(CannotOptInToProcessValue); + /// Cannot opt out from process. + public static Context CannotOptOutFromProcess { get; } = new Context(CannotOptOutFromProcessValue); + /// Cannot reverse process effects. + public static Context CannotReverseProcessEffects { get; } = new Context(CannotReverseProcessEffectsValue); + /// Cannot reverse process input. + public static Context CannotReverseProcessInput { get; } = new Context(CannotReverseProcessInputValue); + /// Cannot reverse process output. + public static Context CannotReverseProcessOutput { get; } = new Context(CannotReverseProcessOutputValue); + /// Cannot withdraw from process. + public static Context CannotWithdrawFromProcess { get; } = new Context(CannotWithdrawFromProcessValue); + /// Challenging process. + public static Context ChallengingProcess { get; } = new Context(ChallengingProcessValue); + /// Challenging process input. + public static Context ChallengingProcessInput { get; } = new Context(ChallengingProcessInputValue); + /// Challenging process output. + public static Context ChallengingProcessOutput { get; } = new Context(ChallengingProcessOutputValue); + /// Conditional automation. + public static Context ConditionalAutomation { get; } = new Context(ConditionalAutomationValue); + /// Consent control. + public static Context ConsentControl { get; } = new Context(ConsentControlValue); + /// Correcting process. + public static Context CorrectingProcess { get; } = new Context(CorrectingProcessValue); + /// Correcting process input. + public static Context CorrectingProcessInput { get; } = new Context(CorrectingProcessInputValue); + /// Correcting process output. + public static Context CorrectingProcessOutput { get; } = new Context(CorrectingProcessOutputValue); + /// Completely manual processing. + public static Context CompletelyManualProcessing { get; } = new Context(CompletelyManualProcessingValue); + /// Data controller data source. + public static Context DataControllerDataSource { get; } = new Context(DataControllerDataSourceValue); + /// Data published by data subject. + public static Context DataPublishedByDataSubject { get; } = new Context(DataPublishedByDataSubjectValue); + /// Data source. + public static Context DataSource { get; } = new Context(DataSourceValue); + /// Data subject. + public static Context DataSubject { get; } = new Context(DataSubjectValue); + /// Data subject data source. + public static Context DataSubjectDataSource { get; } = new Context(DataSubjectDataSourceValue); + /// Data subject scale. + public static Context DataSubjectScale { get; } = new Context(DataSubjectScaleValue); + /// Data volume. + public static Context DataVolume { get; } = new Context(DataVolumeValue); + /// Decision making. + public static Context DecisionMaking { get; } = new Context(DecisionMakingValue); + /// Entity active involvement. + public static Context EntityActiveInvolvement { get; } = new Context(EntityActiveInvolvementValue); + /// Entity involvement. + public static Context EntityInvolvement { get; } = new Context(EntityInvolvementValue); + /// Entity non involvement. + public static Context EntityNonInvolvement { get; } = new Context(EntityNonInvolvementValue); + /// Entity non permissive involvement. + public static Context EntityNonPermissiveInvolvement { get; } = new Context(EntityNonPermissiveInvolvementValue); + /// Entity passive involvement. + public static Context EntityPassiveInvolvement { get; } = new Context(EntityPassiveInvolvementValue); + /// Entity permissive involvement. + public static Context EntityPermissiveInvolvement { get; } = new Context(EntityPermissiveInvolvementValue); + /// Evaluation of individuals. + public static Context EvaluationOfIndividuals { get; } = new Context(EvaluationOfIndividualsValue); + /// Evaluation scoring. + public static Context EvaluationScoring { get; } = new Context(EvaluationScoringValue); + /// Full automation. + public static Context FullAutomation { get; } = new Context(FullAutomationValue); + /// Geographic coverage. + public static Context GeographicCoverage { get; } = new Context(GeographicCoverageValue); + /// Global scale. + public static Context GlobalScale { get; } = new Context(GlobalScaleValue); + /// High automation. + public static Context HighAutomation { get; } = new Context(HighAutomationValue); + /// Huge data volume. + public static Context HugeDataVolume { get; } = new Context(HugeDataVolumeValue); + /// Huge scale of data subjects. + public static Context HugeScaleOfDataSubjects { get; } = new Context(HugeScaleOfDataSubjectsValue); + /// Human involved. + public static Context HumanInvolved { get; } = new Context(HumanInvolvedValue); + /// Human involvement. + public static Context HumanInvolvement { get; } = new Context(HumanInvolvementValue); + /// Human involvement for control. + public static Context HumanInvolvementForControl { get; } = new Context(HumanInvolvementForControlValue); + /// Human involvement for decision. + public static Context HumanInvolvementForDecision { get; } = new Context(HumanInvolvementForDecisionValue); + /// Human involvement for input. + public static Context HumanInvolvementForInput { get; } = new Context(HumanInvolvementForInputValue); + /// Human involvement for intervention. + public static Context HumanInvolvementForIntervention { get; } = new Context(HumanInvolvementForInterventionValue); + /// Human involvement for oversight. + public static Context HumanInvolvementForOversight { get; } = new Context(HumanInvolvementForOversightValue); + /// Human involvement for verification. + public static Context HumanInvolvementForVerification { get; } = new Context(HumanInvolvementForVerificationValue); + /// Human not involved. + public static Context HumanNotInvolved { get; } = new Context(HumanNotInvolvedValue); + /// Innovative use of existing technology. + public static Context InnovativeUseOfExistingTechnology { get; } = new Context(InnovativeUseOfExistingTechnologyValue); + /// Innovative use of new technologies. + public static Context InnovativeUseOfNewTechnologies { get; } = new Context(InnovativeUseOfNewTechnologiesValue); + /// Innovative use of technology. + public static Context InnovativeUseOfTechnology { get; } = new Context(InnovativeUseOfTechnologyValue); + /// Large data volume. + public static Context LargeDataVolume { get; } = new Context(LargeDataVolumeValue); + /// Large scale of data subjects. + public static Context LargeScaleOfDataSubjects { get; } = new Context(LargeScaleOfDataSubjectsValue); + /// Large scale processing. + public static Context LargeScaleProcessing { get; } = new Context(LargeScaleProcessingValue); + /// Local environment scale. + public static Context LocalEnvironmentScale { get; } = new Context(LocalEnvironmentScaleValue); + /// Locality scale. + public static Context LocalityScale { get; } = new Context(LocalityScaleValue); + /// Medium data volume. + public static Context MediumDataVolume { get; } = new Context(MediumDataVolumeValue); + /// Medium scale of data subjects. + public static Context MediumScaleOfDataSubjects { get; } = new Context(MediumScaleOfDataSubjectsValue); + /// Medium scale processing. + public static Context MediumScaleProcessing { get; } = new Context(MediumScaleProcessingValue); + /// Multi national scale. + public static Context MultiNationalScale { get; } = new Context(MultiNationalScaleValue); + /// National scale. + public static Context NationalScale { get; } = new Context(NationalScaleValue); + /// Nearly global scale. + public static Context NearlyGlobalScale { get; } = new Context(NearlyGlobalScaleValue); + /// Non public data source. + public static Context NonPublicDataSource { get; } = new Context(NonPublicDataSourceValue); + /// Not automated. + public static Context NotAutomated { get; } = new Context(NotAutomatedValue); + /// Objecting to process. + public static Context ObjectingToProcess { get; } = new Context(ObjectingToProcessValue); + /// Obtain consent. + public static Context ObtainConsent { get; } = new Context(ObtainConsentValue); + /// Opting in to process. + public static Context OptingInToProcess { get; } = new Context(OptingInToProcessValue); + /// Opting out from process. + public static Context OptingOutFromProcess { get; } = new Context(OptingOutFromProcessValue); + /// Partial automation. + public static Context PartialAutomation { get; } = new Context(PartialAutomationValue); + /// Processing condition. + public static Context ProcessingCondition { get; } = new Context(ProcessingConditionValue); + /// Processing duration. + public static Context ProcessingDuration { get; } = new Context(ProcessingDurationValue); + /// Processing location. + public static Context ProcessingLocation { get; } = new Context(ProcessingLocationValue); + /// Processing scale. + public static Context ProcessingScale { get; } = new Context(ProcessingScaleValue); + /// Provide consent. + public static Context ProvideConsent { get; } = new Context(ProvideConsentValue); + /// Public data source. + public static Context PublicDataSource { get; } = new Context(PublicDataSourceValue); + /// Reaffirm consent. + public static Context ReaffirmConsent { get; } = new Context(ReaffirmConsentValue); + /// Regional scale. + public static Context RegionalScale { get; } = new Context(RegionalScaleValue); + /// Reversing process effects. + public static Context ReversingProcessEffects { get; } = new Context(ReversingProcessEffectsValue); + /// Reversing process input. + public static Context ReversingProcessInput { get; } = new Context(ReversingProcessInputValue); + /// Reversing process output. + public static Context ReversingProcessOutput { get; } = new Context(ReversingProcessOutputValue); + /// Scale. + public static Context Scale { get; } = new Context(ScaleValue); + /// Scoring of individuals. + public static Context ScoringOfIndividuals { get; } = new Context(ScoringOfIndividualsValue); + /// Singular data volume. + public static Context SingularDataVolume { get; } = new Context(SingularDataVolumeValue); + /// Singular scale of data subjects. + public static Context SingularScaleOfDataSubjects { get; } = new Context(SingularScaleOfDataSubjectsValue); + /// Small data volume. + public static Context SmallDataVolume { get; } = new Context(SmallDataVolumeValue); + /// Small scale of data subjects. + public static Context SmallScaleOfDataSubjects { get; } = new Context(SmallScaleOfDataSubjectsValue); + /// Small scale processing. + public static Context SmallScaleProcessing { get; } = new Context(SmallScaleProcessingValue); + /// Sporadic data volume. + public static Context SporadicDataVolume { get; } = new Context(SporadicDataVolumeValue); + /// Sporadic scale of data subjects. + public static Context SporadicScaleOfDataSubjects { get; } = new Context(SporadicScaleOfDataSubjectsValue); + /// Storage condition. + public static Context StorageCondition { get; } = new Context(StorageConditionValue); + /// Storage deletion. + public static Context StorageDeletion { get; } = new Context(StorageDeletionValue); + /// Storage duration. + public static Context StorageDuration { get; } = new Context(StorageDurationValue); + /// Storage location. + public static Context StorageLocation { get; } = new Context(StorageLocationValue); + /// Storage restoration. + public static Context StorageRestoration { get; } = new Context(StorageRestorationValue); + /// Systematic monitoring. + public static Context SystematicMonitoring { get; } = new Context(SystematicMonitoringValue); + /// Third party data source. + public static Context ThirdPartyDataSource { get; } = new Context(ThirdPartyDataSourceValue); + /// Withdraw consent. + public static Context WithdrawConsent { get; } = new Context(WithdrawConsentValue); + /// Withdrawing from process. + public static Context WithdrawingFromProcess { get; } = new Context(WithdrawingFromProcessValue); + /// Determines if two values are the same. + public static bool operator ==(Context left, Context right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Context left, Context right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Context(string value) => new Context(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Context other && Equals(other); + /// + public bool Equals(Context 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/DataProcessing.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/DataProcessing.Serialization.cs new file mode 100644 index 000000000000..10008b5a9213 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/DataProcessing.Serialization.cs @@ -0,0 +1,203 @@ +// 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.ProgrammableConnectivity.Models +{ + public partial class DataProcessing : 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(DataProcessing)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("processingOperation"u8); + writer.WriteStringValue(ProcessingOperation.ToString()); + writer.WritePropertyName("contexts"u8); + writer.WriteStartArray(); + foreach (var item in Contexts) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + writer.WritePropertyName("duration"u8); + writer.WriteStringValue(Duration.ToString()); + writer.WritePropertyName("frequency"u8); + writer.WriteStringValue(Frequency.ToString()); + writer.WritePropertyName("transitRegions"u8); + writer.WriteStartArray(); + foreach (var item in TransitRegions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("storageRegions"u8); + writer.WriteStartArray(); + foreach (var item in StorageRegions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataProcessing 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(DataProcessing)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataProcessing(document.RootElement, options); + } + + internal static DataProcessing DeserializeDataProcessing(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProcessingOperation processingOperation = default; + IList contexts = default; + Duration duration = default; + Frequency frequency = default; + IList transitRegions = default; + IList storageRegions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("processingOperation"u8)) + { + processingOperation = new ProcessingOperation(property.Value.GetString()); + continue; + } + if (property.NameEquals("contexts"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new Context(item.GetString())); + } + contexts = array; + continue; + } + if (property.NameEquals("duration"u8)) + { + duration = new Duration(property.Value.GetString()); + continue; + } + if (property.NameEquals("frequency"u8)) + { + frequency = new Frequency(property.Value.GetString()); + continue; + } + if (property.NameEquals("transitRegions"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataRegions.DeserializeDataRegions(item, options)); + } + transitRegions = array; + continue; + } + if (property.NameEquals("storageRegions"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataRegions.DeserializeDataRegions(item, options)); + } + storageRegions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataProcessing( + processingOperation, + contexts, + duration, + frequency, + transitRegions, + storageRegions, + 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, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(DataProcessing)} does not support writing '{options.Format}' format."); + } + } + + DataProcessing 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 DeserializeDataProcessing(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataProcessing)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/DataProcessing.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/DataProcessing.cs new file mode 100644 index 000000000000..a8ddb3b6487a --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/DataProcessing.cs @@ -0,0 +1,108 @@ +// 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.ProgrammableConnectivity.Models +{ + /// Model defining how received data is processed. + public partial class DataProcessing + { + /// + /// 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 operation that is performed on the data received. + /// The contexts in which the data is processed. + /// The duration or temporal limitation of the data processing. + /// The frequency of the data processing. + /// The countries/regions the data transits through. + /// The countries/regions the data is stored in. + /// , or is null. + public DataProcessing(ProcessingOperation processingOperation, IEnumerable contexts, Duration duration, Frequency frequency, IEnumerable transitRegions, IEnumerable storageRegions) + { + Argument.AssertNotNull(contexts, nameof(contexts)); + Argument.AssertNotNull(transitRegions, nameof(transitRegions)); + Argument.AssertNotNull(storageRegions, nameof(storageRegions)); + + ProcessingOperation = processingOperation; + Contexts = contexts.ToList(); + Duration = duration; + Frequency = frequency; + TransitRegions = transitRegions.ToList(); + StorageRegions = storageRegions.ToList(); + } + + /// Initializes a new instance of . + /// The operation that is performed on the data received. + /// The contexts in which the data is processed. + /// The duration or temporal limitation of the data processing. + /// The frequency of the data processing. + /// The countries/regions the data transits through. + /// The countries/regions the data is stored in. + /// Keeps track of any properties unknown to the library. + internal DataProcessing(ProcessingOperation processingOperation, IList contexts, Duration duration, Frequency frequency, IList transitRegions, IList storageRegions, IDictionary serializedAdditionalRawData) + { + ProcessingOperation = processingOperation; + Contexts = contexts; + Duration = duration; + Frequency = frequency; + TransitRegions = transitRegions; + StorageRegions = storageRegions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataProcessing() + { + } + + /// The operation that is performed on the data received. + public ProcessingOperation ProcessingOperation { get; set; } + /// The contexts in which the data is processed. + public IList Contexts { get; } + /// The duration or temporal limitation of the data processing. + public Duration Duration { get; set; } + /// The frequency of the data processing. + public Frequency Frequency { get; set; } + /// The countries/regions the data transits through. + public IList TransitRegions { get; } + /// The countries/regions the data is stored in. + public IList StorageRegions { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/DataRegions.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/DataRegions.Serialization.cs new file mode 100644 index 000000000000..ee78140aefaf --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/DataRegions.Serialization.cs @@ -0,0 +1,153 @@ +// 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.ProgrammableConnectivity.Models +{ + public partial class DataRegions : 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(DataRegions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("countryCode"u8); + writer.WriteStringValue(CountryCode); + if (Optional.IsDefined(CommercialOrganization)) + { + writer.WritePropertyName("commercialOrganization"u8); + writer.WriteStringValue(CommercialOrganization); + } + writer.WritePropertyName("commercialActivity"u8); + writer.WriteBooleanValue(CommercialActivity); + writer.WritePropertyName("dataPrivacyFrameworkUrl"u8); + writer.WriteStringValue(DataPrivacyFrameworkUri.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 + } + } + } + + DataRegions 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(DataRegions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataRegions(document.RootElement, options); + } + + internal static DataRegions DeserializeDataRegions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string countryCode = default; + string commercialOrganization = default; + bool commercialActivity = default; + Uri dataPrivacyFrameworkUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("countryCode"u8)) + { + countryCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("commercialOrganization"u8)) + { + commercialOrganization = property.Value.GetString(); + continue; + } + if (property.NameEquals("commercialActivity"u8)) + { + commercialActivity = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dataPrivacyFrameworkUrl"u8)) + { + dataPrivacyFrameworkUrl = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataRegions(countryCode, commercialOrganization, commercialActivity, dataPrivacyFrameworkUrl, 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, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(DataRegions)} does not support writing '{options.Format}' format."); + } + } + + DataRegions 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 DeserializeDataRegions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataRegions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/DataRegions.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/DataRegions.cs new file mode 100644 index 000000000000..b432009f074b --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/DataRegions.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Model defining the information required about the countries/regions the data transits through or is stored in. + public partial class DataRegions + { + /// + /// 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 country code of the country/region the data transits through or is stored in. + /// Flag to indicate if commercial activity applies to this data management. + /// URL of the organization or governmental data privacy framework. + /// or is null. + public DataRegions(string countryCode, bool commercialActivity, Uri dataPrivacyFrameworkUri) + { + Argument.AssertNotNull(countryCode, nameof(countryCode)); + Argument.AssertNotNull(dataPrivacyFrameworkUri, nameof(dataPrivacyFrameworkUri)); + + CountryCode = countryCode; + CommercialActivity = commercialActivity; + DataPrivacyFrameworkUri = dataPrivacyFrameworkUri; + } + + /// Initializes a new instance of . + /// The country code of the country/region the data transits through or is stored in. + /// The commercial organization who is managing the data. + /// Flag to indicate if commercial activity applies to this data management. + /// URL of the organization or governmental data privacy framework. + /// Keeps track of any properties unknown to the library. + internal DataRegions(string countryCode, string commercialOrganization, bool commercialActivity, Uri dataPrivacyFrameworkUri, IDictionary serializedAdditionalRawData) + { + CountryCode = countryCode; + CommercialOrganization = commercialOrganization; + CommercialActivity = commercialActivity; + DataPrivacyFrameworkUri = dataPrivacyFrameworkUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataRegions() + { + } + + /// The country code of the country/region the data transits through or is stored in. + public string CountryCode { get; set; } + /// The commercial organization who is managing the data. + public string CommercialOrganization { get; set; } + /// Flag to indicate if commercial activity applies to this data management. + public bool CommercialActivity { get; set; } + /// URL of the organization or governmental data privacy framework. + public Uri DataPrivacyFrameworkUri { get; set; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Duration.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Duration.cs new file mode 100644 index 000000000000..1b9fac0422df --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Duration.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Valid values for the duration based on W3C Data Privacy Vocabulary v2 https://w3c.github.io/dpv/2.0/dpv/. + public readonly partial struct Duration : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Duration(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EndlessDurationValue = "Endless"; + private const string FixedOccurrencesDurationValue = "Fixed occurrences"; + private const string IndeterminateDurationValue = "Indeterminate"; + private const string TemporalDurationValue = "Temporal"; + private const string UntilEventDurationValue = "Until event"; + private const string UntilTimeDurationValue = "Until time"; + + /// Endless. + public static Duration EndlessDuration { get; } = new Duration(EndlessDurationValue); + /// Fixed occurrences. + public static Duration FixedOccurrencesDuration { get; } = new Duration(FixedOccurrencesDurationValue); + /// Indeterminate. + public static Duration IndeterminateDuration { get; } = new Duration(IndeterminateDurationValue); + /// Temporal. + public static Duration TemporalDuration { get; } = new Duration(TemporalDurationValue); + /// Until event. + public static Duration UntilEventDuration { get; } = new Duration(UntilEventDurationValue); + /// Until time. + public static Duration UntilTimeDuration { get; } = new Duration(UntilTimeDurationValue); + /// Determines if two values are the same. + public static bool operator ==(Duration left, Duration right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Duration left, Duration right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Duration(string value) => new Duration(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Duration other && Equals(other); + /// + public bool Equals(Duration 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Frequency.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Frequency.cs new file mode 100644 index 000000000000..ad58f5f6101c --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Frequency.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.ProgrammableConnectivity.Models +{ + /// Valid values for the frequency based on W3C Data Privacy Vocabulary v2 https://w3c.github.io/dpv/2.0/dpv/. + public readonly partial struct Frequency : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Frequency(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ContinuousFrequencyValue = "Continuous"; + private const string OftenFrequencyValue = "Often"; + private const string SingularFrequencyValue = "Singular"; + private const string SporadicFrequencyValue = "Sporadic"; + + /// Continuous. + public static Frequency ContinuousFrequency { get; } = new Frequency(ContinuousFrequencyValue); + /// Often. + public static Frequency OftenFrequency { get; } = new Frequency(OftenFrequencyValue); + /// Singular. + public static Frequency SingularFrequency { get; } = new Frequency(SingularFrequencyValue); + /// Sporadic. + public static Frequency SporadicFrequency { get; } = new Frequency(SporadicFrequencyValue); + /// Determines if two values are the same. + public static bool operator ==(Frequency left, Frequency right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Frequency left, Frequency right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Frequency(string value) => new Frequency(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Frequency other && Equals(other); + /// + public bool Equals(Frequency 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayListResult.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayListResult.Serialization.cs new file mode 100644 index 000000000000..3a0ed1894653 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayListResult.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.ProgrammableConnectivity.Models +{ + internal partial class GatewayListResult : 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(GatewayListResult)} 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 + } + } + } + + GatewayListResult 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(GatewayListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGatewayListResult(document.RootElement, options); + } + + internal static GatewayListResult DeserializeGatewayListResult(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(GatewayData.DeserializeGatewayData(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 GatewayListResult(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, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(GatewayListResult)} does not support writing '{options.Format}' format."); + } + } + + GatewayListResult 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 DeserializeGatewayListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GatewayListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayListResult.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayListResult.cs new file mode 100644 index 000000000000..017bd3cbb639 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayListResult.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.ProgrammableConnectivity.Models +{ + /// The response of a Gateway list operation. + internal partial class GatewayListResult + { + /// + /// 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 Gateway items on this page. + /// is null. + internal GatewayListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Gateway items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal GatewayListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GatewayListResult() + { + } + + /// The Gateway items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayPatch.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayPatch.Serialization.cs new file mode 100644 index 000000000000..d3fdf5be86f9 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayPatch.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + public partial class GatewayPatch : 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(GatewayPatch)} 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 (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 + } + } + } + + GatewayPatch 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(GatewayPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGatewayPatch(document.RootElement, options); + } + + internal static GatewayPatch DeserializeGatewayPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = 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 (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GatewayPatch(tags ?? 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, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(GatewayPatch)} does not support writing '{options.Format}' format."); + } + } + + GatewayPatch 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 DeserializeGatewayPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GatewayPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayPatch.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayPatch.cs new file mode 100644 index 000000000000..b975b760e125 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayPatch.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// The type used for updating tags in Gateway resources. + public partial class GatewayPatch + { + /// + /// 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 GatewayPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Keeps track of any properties unknown to the library. + internal GatewayPatch(IDictionary tags, IDictionary serializedAdditionalRawData) + { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayProperties.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayProperties.Serialization.cs new file mode 100644 index 000000000000..9e8b8e226997 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayProperties.Serialization.cs @@ -0,0 +1,203 @@ +// 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.ProgrammableConnectivity.Models +{ + public partial class GatewayProperties : 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(GatewayProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(OperatorApiConnections)) + { + writer.WritePropertyName("operatorApiConnections"u8); + writer.WriteStartArray(); + foreach (var item in OperatorApiConnections) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(GatewayBaseUri)) + { + writer.WritePropertyName("gatewayBaseUrl"u8); + writer.WriteStringValue(GatewayBaseUri); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("configuredApplication"u8); + writer.WriteObjectValue(ConfiguredApplication, options); + writer.WritePropertyName("configuredApplicationOwner"u8); + writer.WriteObjectValue(ConfiguredApplicationOwner, 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 + } + } + } + + GatewayProperties 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(GatewayProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGatewayProperties(document.RootElement, options); + } + + internal static GatewayProperties DeserializeGatewayProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList operatorApiConnections = default; + string gatewayBaseUrl = default; + ProvisioningState? provisioningState = default; + ApplicationProperties configuredApplication = default; + ApplicationOwnerProperties configuredApplicationOwner = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("operatorApiConnections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + operatorApiConnections = array; + continue; + } + if (property.NameEquals("gatewayBaseUrl"u8)) + { + gatewayBaseUrl = 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("configuredApplication"u8)) + { + configuredApplication = ApplicationProperties.DeserializeApplicationProperties(property.Value, options); + continue; + } + if (property.NameEquals("configuredApplicationOwner"u8)) + { + configuredApplicationOwner = ApplicationOwnerProperties.DeserializeApplicationOwnerProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GatewayProperties( + operatorApiConnections ?? new ChangeTrackingList(), + gatewayBaseUrl, + provisioningState, + configuredApplication, + configuredApplicationOwner, + 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, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(GatewayProperties)} does not support writing '{options.Format}' format."); + } + } + + GatewayProperties 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 DeserializeGatewayProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GatewayProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayProperties.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayProperties.cs new file mode 100644 index 000000000000..5fa580b3559f --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GatewayProperties.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Gateway resource properties. + public partial class GatewayProperties + { + /// + /// 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 . + /// Details about the Application that would use the Operator's Network APIs. + /// Details about the Organization owning the Application that would use the Operator's Network APIs. + /// or is null. + public GatewayProperties(ApplicationProperties configuredApplication, ApplicationOwnerProperties configuredApplicationOwner) + { + Argument.AssertNotNull(configuredApplication, nameof(configuredApplication)); + Argument.AssertNotNull(configuredApplicationOwner, nameof(configuredApplicationOwner)); + + OperatorApiConnections = new ChangeTrackingList(); + ConfiguredApplication = configuredApplication; + ConfiguredApplicationOwner = configuredApplicationOwner; + } + + /// Initializes a new instance of . + /// List of Operator API Connections selected by the user. + /// Base URL of the Gateway resource. This is the URL that the users would use to make Network API requests to the Operators via Azure. + /// The status of the last operation on the Gateway resource. + /// Details about the Application that would use the Operator's Network APIs. + /// Details about the Organization owning the Application that would use the Operator's Network APIs. + /// Keeps track of any properties unknown to the library. + internal GatewayProperties(IReadOnlyList operatorApiConnections, string gatewayBaseUri, ProvisioningState? provisioningState, ApplicationProperties configuredApplication, ApplicationOwnerProperties configuredApplicationOwner, IDictionary serializedAdditionalRawData) + { + OperatorApiConnections = operatorApiConnections; + GatewayBaseUri = gatewayBaseUri; + ProvisioningState = provisioningState; + ConfiguredApplication = configuredApplication; + ConfiguredApplicationOwner = configuredApplicationOwner; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GatewayProperties() + { + } + + /// List of Operator API Connections selected by the user. + public IReadOnlyList OperatorApiConnections { get; } + /// Base URL of the Gateway resource. This is the URL that the users would use to make Network API requests to the Operators via Azure. + public string GatewayBaseUri { get; } + /// The status of the last operation on the Gateway resource. + public ProvisioningState? ProvisioningState { get; } + /// Details about the Application that would use the Operator's Network APIs. + public ApplicationProperties ConfiguredApplication { get; set; } + /// Details about the Organization owning the Application that would use the Operator's Network APIs. + public ApplicationOwnerProperties ConfiguredApplicationOwner { get; set; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GeographicAddress.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GeographicAddress.Serialization.cs new file mode 100644 index 000000000000..e2ee7014a005 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GeographicAddress.Serialization.cs @@ -0,0 +1,200 @@ +// 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.ProgrammableConnectivity.Models +{ + public partial class GeographicAddress : 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(GeographicAddress)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(StreetNumber)) + { + writer.WritePropertyName("streetNumber"u8); + writer.WriteStringValue(StreetNumber); + } + if (Optional.IsDefined(StreetName)) + { + writer.WritePropertyName("streetName"u8); + writer.WriteStringValue(StreetName); + } + if (Optional.IsDefined(Locality)) + { + writer.WritePropertyName("locality"u8); + writer.WriteStringValue(Locality); + } + if (Optional.IsDefined(City)) + { + writer.WritePropertyName("city"u8); + writer.WriteStringValue(City); + } + if (Optional.IsDefined(StateOrProvince)) + { + writer.WritePropertyName("stateOrProvince"u8); + writer.WriteStringValue(StateOrProvince); + } + if (Optional.IsDefined(PostalCode)) + { + writer.WritePropertyName("postalCode"u8); + writer.WriteStringValue(PostalCode); + } + writer.WritePropertyName("countryCode"u8); + writer.WriteStringValue(CountryCode); + 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 + } + } + } + + GeographicAddress 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(GeographicAddress)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGeographicAddress(document.RootElement, options); + } + + internal static GeographicAddress DeserializeGeographicAddress(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string streetNumber = default; + string streetName = default; + string locality = default; + string city = default; + string stateOrProvince = default; + string postalCode = default; + string countryCode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("streetNumber"u8)) + { + streetNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("streetName"u8)) + { + streetName = property.Value.GetString(); + continue; + } + if (property.NameEquals("locality"u8)) + { + locality = property.Value.GetString(); + continue; + } + if (property.NameEquals("city"u8)) + { + city = property.Value.GetString(); + continue; + } + if (property.NameEquals("stateOrProvince"u8)) + { + stateOrProvince = property.Value.GetString(); + continue; + } + if (property.NameEquals("postalCode"u8)) + { + postalCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("countryCode"u8)) + { + countryCode = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GeographicAddress( + streetNumber, + streetName, + locality, + city, + stateOrProvince, + postalCode, + countryCode, + 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, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(GeographicAddress)} does not support writing '{options.Format}' format."); + } + } + + GeographicAddress 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 DeserializeGeographicAddress(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GeographicAddress)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GeographicAddress.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GeographicAddress.cs new file mode 100644 index 000000000000..dfc78f063915 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/GeographicAddress.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Model defining a geographic address. + public partial class GeographicAddress + { + /// + /// 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 . + /// Country code of the address. + /// is null. + public GeographicAddress(string countryCode) + { + Argument.AssertNotNull(countryCode, nameof(countryCode)); + + CountryCode = countryCode; + } + + /// Initializes a new instance of . + /// Street Number of the address. + /// Street Name of the address. + /// Locality of the address. + /// City of the address. + /// State or province of the address. + /// Postal code of the address. + /// Country code of the address. + /// Keeps track of any properties unknown to the library. + internal GeographicAddress(string streetNumber, string streetName, string locality, string city, string stateOrProvince, string postalCode, string countryCode, IDictionary serializedAdditionalRawData) + { + StreetNumber = streetNumber; + StreetName = streetName; + Locality = locality; + City = city; + StateOrProvince = stateOrProvince; + PostalCode = postalCode; + CountryCode = countryCode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GeographicAddress() + { + } + + /// Street Number of the address. + public string StreetNumber { get; set; } + /// Street Name of the address. + public string StreetName { get; set; } + /// Locality of the address. + public string Locality { get; set; } + /// City of the address. + public string City { get; set; } + /// State or province of the address. + public string StateOrProvince { get; set; } + /// Postal code of the address. + public string PostalCode { get; set; } + /// Country code of the address. + public string CountryCode { get; set; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/LocalRepresentative.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/LocalRepresentative.Serialization.cs new file mode 100644 index 000000000000..31d4e1da3090 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/LocalRepresentative.Serialization.cs @@ -0,0 +1,134 @@ +// 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.ProgrammableConnectivity.Models +{ + public partial class LocalRepresentative : 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(LocalRepresentative)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("countryCode"u8); + writer.WriteStringValue(CountryCode); + writer.WritePropertyName("representative"u8); + writer.WriteObjectValue(Representative, 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 + } + } + } + + LocalRepresentative 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(LocalRepresentative)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLocalRepresentative(document.RootElement, options); + } + + internal static LocalRepresentative DeserializeLocalRepresentative(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string countryCode = default; + Person representative = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("countryCode"u8)) + { + countryCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("representative"u8)) + { + representative = Person.DeserializePerson(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LocalRepresentative(countryCode, representative, 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, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(LocalRepresentative)} does not support writing '{options.Format}' format."); + } + } + + LocalRepresentative 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 DeserializeLocalRepresentative(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LocalRepresentative)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/LocalRepresentative.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/LocalRepresentative.cs new file mode 100644 index 000000000000..47df015e6217 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/LocalRepresentative.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Model defining a local representative for a country/region. + public partial class LocalRepresentative + { + /// + /// 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 . + /// Country code for the country/region the local representative is representing. + /// Local representative for this country/region. + /// or is null. + public LocalRepresentative(string countryCode, Person representative) + { + Argument.AssertNotNull(countryCode, nameof(countryCode)); + Argument.AssertNotNull(representative, nameof(representative)); + + CountryCode = countryCode; + Representative = representative; + } + + /// Initializes a new instance of . + /// Country code for the country/region the local representative is representing. + /// Local representative for this country/region. + /// Keeps track of any properties unknown to the library. + internal LocalRepresentative(string countryCode, Person representative, IDictionary serializedAdditionalRawData) + { + CountryCode = countryCode; + Representative = representative; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal LocalRepresentative() + { + } + + /// Country code for the country/region the local representative is representing. + public string CountryCode { get; set; } + /// Local representative for this country/region. + public Person Representative { get; set; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/MarketplaceProperties.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/MarketplaceProperties.Serialization.cs new file mode 100644 index 000000000000..f1fad9e62313 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/MarketplaceProperties.Serialization.cs @@ -0,0 +1,172 @@ +// 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.ProgrammableConnectivity.Models +{ + public partial class MarketplaceProperties : 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(MarketplaceProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(OfferId)) + { + writer.WritePropertyName("offerId"u8); + writer.WriteStringValue(OfferId); + } + if (Optional.IsDefined(PublisherId)) + { + writer.WritePropertyName("publisherId"u8); + writer.WriteStringValue(PublisherId); + } + if (Optional.IsDefined(PlanId)) + { + writer.WritePropertyName("planId"u8); + writer.WriteStringValue(PlanId); + } + if (options.Format != "W") + { + writer.WritePropertyName("planTermsAndConditionsLinks"u8); + writer.WriteStartArray(); + foreach (var item in PlanTermsAndConditionsLinks) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MarketplaceProperties 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(MarketplaceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMarketplaceProperties(document.RootElement, options); + } + + internal static MarketplaceProperties DeserializeMarketplaceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string offerId = default; + string publisherId = default; + string planId = default; + IReadOnlyList planTermsAndConditionsLinks = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("offerId"u8)) + { + offerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("publisherId"u8)) + { + publisherId = property.Value.GetString(); + continue; + } + if (property.NameEquals("planId"u8)) + { + planId = property.Value.GetString(); + continue; + } + if (property.NameEquals("planTermsAndConditionsLinks"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + planTermsAndConditionsLinks = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MarketplaceProperties(offerId, publisherId, planId, planTermsAndConditionsLinks, 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, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(MarketplaceProperties)} does not support writing '{options.Format}' format."); + } + } + + MarketplaceProperties 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 DeserializeMarketplaceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MarketplaceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/MarketplaceProperties.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/MarketplaceProperties.cs new file mode 100644 index 000000000000..a4fd08c4f148 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/MarketplaceProperties.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Azure marketplace properties for a plan. + public partial class MarketplaceProperties + { + /// + /// 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 . + /// + /// Links to the Terms and Conditions of the Plan that must be accepted to create an + /// associated Operator Api Connection + /// + internal MarketplaceProperties(IEnumerable planTermsAndConditionsLinks) + { + PlanTermsAndConditionsLinks = planTermsAndConditionsLinks.ToList(); + } + + /// Initializes a new instance of . + /// Azure marketplace Offer ID for this plan. + /// Azure marketplace Publisher ID for this plan. + /// Azure marketplace Plan ID for this plan. + /// + /// Links to the Terms and Conditions of the Plan that must be accepted to create an + /// associated Operator Api Connection + /// + /// Keeps track of any properties unknown to the library. + internal MarketplaceProperties(string offerId, string publisherId, string planId, IReadOnlyList planTermsAndConditionsLinks, IDictionary serializedAdditionalRawData) + { + OfferId = offerId; + PublisherId = publisherId; + PlanId = planId; + PlanTermsAndConditionsLinks = planTermsAndConditionsLinks; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MarketplaceProperties() + { + } + + /// Azure marketplace Offer ID for this plan. + public string OfferId { get; } + /// Azure marketplace Publisher ID for this plan. + public string PublisherId { get; } + /// Azure marketplace Plan ID for this plan. + public string PlanId { get; } + /// + /// Links to the Terms and Conditions of the Plan that must be accepted to create an + /// associated Operator Api Connection + /// + public IReadOnlyList PlanTermsAndConditionsLinks { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionListResult.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionListResult.Serialization.cs new file mode 100644 index 000000000000..bc807f73cfc4 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionListResult.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.ProgrammableConnectivity.Models +{ + internal partial class OperatorApiConnectionListResult : 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(OperatorApiConnectionListResult)} 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 + } + } + } + + OperatorApiConnectionListResult 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(OperatorApiConnectionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperatorApiConnectionListResult(document.RootElement, options); + } + + internal static OperatorApiConnectionListResult DeserializeOperatorApiConnectionListResult(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(OperatorApiConnectionData.DeserializeOperatorApiConnectionData(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 OperatorApiConnectionListResult(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, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(OperatorApiConnectionListResult)} does not support writing '{options.Format}' format."); + } + } + + OperatorApiConnectionListResult 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 DeserializeOperatorApiConnectionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperatorApiConnectionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionListResult.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionListResult.cs new file mode 100644 index 000000000000..f12cae50f62d --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionListResult.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.ProgrammableConnectivity.Models +{ + /// The response of a OperatorApiConnection list operation. + internal partial class OperatorApiConnectionListResult + { + /// + /// 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 OperatorApiConnection items on this page. + /// is null. + internal OperatorApiConnectionListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The OperatorApiConnection items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal OperatorApiConnectionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OperatorApiConnectionListResult() + { + } + + /// The OperatorApiConnection items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionPatch.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionPatch.Serialization.cs new file mode 100644 index 000000000000..6b401fbda248 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionPatch.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.ProgrammableConnectivity.Models +{ + public partial class OperatorApiConnectionPatch : 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(OperatorApiConnectionPatch)} 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(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OperatorApiConnectionPatch 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(OperatorApiConnectionPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperatorApiConnectionPatch(document.RootElement, options); + } + + internal static OperatorApiConnectionPatch DeserializeOperatorApiConnectionPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + OperatorApiConnectionUpdateProperties properties = 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("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = OperatorApiConnectionUpdateProperties.DeserializeOperatorApiConnectionUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperatorApiConnectionPatch(tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(OperatorApiConnectionPatch)} does not support writing '{options.Format}' format."); + } + } + + OperatorApiConnectionPatch 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 DeserializeOperatorApiConnectionPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperatorApiConnectionPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionPatch.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionPatch.cs new file mode 100644 index 000000000000..4f99116b3eee --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionPatch.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.ProgrammableConnectivity.Models +{ + /// The type used for update operations of the OperatorApiConnection. + public partial class OperatorApiConnectionPatch + { + /// + /// 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 OperatorApiConnectionPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal OperatorApiConnectionPatch(IDictionary tags, OperatorApiConnectionUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + public OperatorApiConnectionUpdateProperties Properties { get; set; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionProperties.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..4a917cff66de --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionProperties.Serialization.cs @@ -0,0 +1,275 @@ +// 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.ProgrammableConnectivity.Models +{ + public partial class OperatorApiConnectionProperties : 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(OperatorApiConnectionProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("operatorApiPlanId"u8); + writer.WriteStringValue(OperatorApiPlanId); + writer.WritePropertyName("gatewayId"u8); + writer.WriteStringValue(GatewayId); + if (options.Format != "W" && Optional.IsDefined(OperatorName)) + { + writer.WritePropertyName("operatorName"u8); + writer.WriteStringValue(OperatorName); + } + if (options.Format != "W" && Optional.IsDefined(CamaraApiName)) + { + writer.WritePropertyName("camaraApiName"u8); + writer.WriteStringValue(CamaraApiName); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); + } + writer.WritePropertyName("planTermsAndConditionsAccepted"u8); + writer.WriteBooleanValue(PlanTermsAndConditionsAccepted); + if (options.Format != "W" && Optional.IsCollectionDefined(PlanTermsAndConditionsLinks)) + { + writer.WritePropertyName("planTermsAndConditionsLinks"u8); + writer.WriteStartArray(); + foreach (var item in PlanTermsAndConditionsLinks) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("purposes"u8); + writer.WriteStartArray(); + foreach (var item in Purposes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + writer.WritePropertyName("purposeReason"u8); + writer.WriteStringValue(PurposeReason); + writer.WritePropertyName("dataProcessingList"u8); + writer.WriteStartArray(); + foreach (var item in DataProcessingList) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OperatorApiConnectionProperties 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(OperatorApiConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperatorApiConnectionProperties(document.RootElement, options); + } + + internal static OperatorApiConnectionProperties DeserializeOperatorApiConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier operatorApiPlanId = default; + ResourceIdentifier gatewayId = default; + string operatorName = default; + string camaraApiName = default; + ProvisioningState? provisioningState = default; + Status status = default; + bool planTermsAndConditionsAccepted = default; + IReadOnlyList planTermsAndConditionsLinks = default; + IList purposes = default; + string purposeReason = default; + IList dataProcessingList = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("operatorApiPlanId"u8)) + { + operatorApiPlanId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("gatewayId"u8)) + { + gatewayId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("operatorName"u8)) + { + operatorName = property.Value.GetString(); + continue; + } + if (property.NameEquals("camaraApiName"u8)) + { + camaraApiName = 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("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = Status.DeserializeStatus(property.Value, options); + continue; + } + if (property.NameEquals("planTermsAndConditionsAccepted"u8)) + { + planTermsAndConditionsAccepted = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("planTermsAndConditionsLinks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + planTermsAndConditionsLinks = array; + continue; + } + if (property.NameEquals("purposes"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new Purpose(item.GetString())); + } + purposes = array; + continue; + } + if (property.NameEquals("purposeReason"u8)) + { + purposeReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataProcessingList"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataProcessing.DeserializeDataProcessing(item, options)); + } + dataProcessingList = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperatorApiConnectionProperties( + operatorApiPlanId, + gatewayId, + operatorName, + camaraApiName, + provisioningState, + status, + planTermsAndConditionsAccepted, + planTermsAndConditionsLinks ?? new ChangeTrackingList(), + purposes, + purposeReason, + dataProcessingList, + 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, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(OperatorApiConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + OperatorApiConnectionProperties 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 DeserializeOperatorApiConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperatorApiConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionProperties.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionProperties.cs new file mode 100644 index 000000000000..5397674ea180 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionProperties.cs @@ -0,0 +1,150 @@ +// 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; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Operator API Connection resource properties that cannot be updated once a resource has been created. + public partial class OperatorApiConnectionProperties + { + /// + /// 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 . + /// Reference to the Operator API Plan Resource ID. + /// Reference to the APC Gateway resource ID. + /// + /// Whether the caller has accepted the Terms and Conditions of the associated Operator API Plan. + /// After creation, the planTermsAndConditionsLink property is set to the Terms and Conditions that + /// have been accepted. + /// + /// Must be set to True, as the Terms and Conditions must be accepted. + /// + /// The purpose for which the Application will use the API. Max Items 1 currently as Operators do not support multiple. + /// Explanation of the reason that justifies the purpose: specifically why is the API used for the application's use case. + /// List of ways the data returned on this API is processed. + /// , , , or is null. + public OperatorApiConnectionProperties(ResourceIdentifier operatorApiPlanId, ResourceIdentifier gatewayId, bool planTermsAndConditionsAccepted, IEnumerable purposes, string purposeReason, IEnumerable dataProcessingList) + { + Argument.AssertNotNull(operatorApiPlanId, nameof(operatorApiPlanId)); + Argument.AssertNotNull(gatewayId, nameof(gatewayId)); + Argument.AssertNotNull(purposes, nameof(purposes)); + Argument.AssertNotNull(purposeReason, nameof(purposeReason)); + Argument.AssertNotNull(dataProcessingList, nameof(dataProcessingList)); + + OperatorApiPlanId = operatorApiPlanId; + GatewayId = gatewayId; + PlanTermsAndConditionsAccepted = planTermsAndConditionsAccepted; + PlanTermsAndConditionsLinks = new ChangeTrackingList(); + Purposes = purposes.ToList(); + PurposeReason = purposeReason; + DataProcessingList = dataProcessingList.ToList(); + } + + /// Initializes a new instance of . + /// Reference to the Operator API Plan Resource ID. + /// Reference to the APC Gateway resource ID. + /// Name of the Operator in the linked Operator API Plan belongs to. + /// The Network API for the current operator in the country/region provided in the linked Operator API Plan. + /// The status of the last operation. + /// The status of the OperatorApiConnection resource. + /// + /// Whether the caller has accepted the Terms and Conditions of the associated Operator API Plan. + /// After creation, the planTermsAndConditionsLink property is set to the Terms and Conditions that + /// have been accepted. + /// + /// Must be set to True, as the Terms and Conditions must be accepted. + /// + /// Links to the Terms and Conditions of the Operator API Plan that were accepted on creation. + /// The purpose for which the Application will use the API. Max Items 1 currently as Operators do not support multiple. + /// Explanation of the reason that justifies the purpose: specifically why is the API used for the application's use case. + /// List of ways the data returned on this API is processed. + /// Keeps track of any properties unknown to the library. + internal OperatorApiConnectionProperties(ResourceIdentifier operatorApiPlanId, ResourceIdentifier gatewayId, string operatorName, string camaraApiName, ProvisioningState? provisioningState, Status status, bool planTermsAndConditionsAccepted, IReadOnlyList planTermsAndConditionsLinks, IList purposes, string purposeReason, IList dataProcessingList, IDictionary serializedAdditionalRawData) + { + OperatorApiPlanId = operatorApiPlanId; + GatewayId = gatewayId; + OperatorName = operatorName; + CamaraApiName = camaraApiName; + ProvisioningState = provisioningState; + Status = status; + PlanTermsAndConditionsAccepted = planTermsAndConditionsAccepted; + PlanTermsAndConditionsLinks = planTermsAndConditionsLinks; + Purposes = purposes; + PurposeReason = purposeReason; + DataProcessingList = dataProcessingList; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OperatorApiConnectionProperties() + { + } + + /// Reference to the Operator API Plan Resource ID. + public ResourceIdentifier OperatorApiPlanId { get; set; } + /// Reference to the APC Gateway resource ID. + public ResourceIdentifier GatewayId { get; set; } + /// Name of the Operator in the linked Operator API Plan belongs to. + public string OperatorName { get; } + /// The Network API for the current operator in the country/region provided in the linked Operator API Plan. + public string CamaraApiName { get; } + /// The status of the last operation. + public ProvisioningState? ProvisioningState { get; } + /// The status of the OperatorApiConnection resource. + public Status Status { get; } + /// + /// Whether the caller has accepted the Terms and Conditions of the associated Operator API Plan. + /// After creation, the planTermsAndConditionsLink property is set to the Terms and Conditions that + /// have been accepted. + /// + /// Must be set to True, as the Terms and Conditions must be accepted. + /// + public bool PlanTermsAndConditionsAccepted { get; set; } + /// Links to the Terms and Conditions of the Operator API Plan that were accepted on creation. + public IReadOnlyList PlanTermsAndConditionsLinks { get; } + /// The purpose for which the Application will use the API. Max Items 1 currently as Operators do not support multiple. + public IList Purposes { get; } + /// Explanation of the reason that justifies the purpose: specifically why is the API used for the application's use case. + public string PurposeReason { get; set; } + /// List of ways the data returned on this API is processed. + public IList DataProcessingList { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionUpdateProperties.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..04b8da57e4a1 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionUpdateProperties.Serialization.cs @@ -0,0 +1,215 @@ +// 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.ProgrammableConnectivity.Models +{ + public partial class OperatorApiConnectionUpdateProperties : 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(OperatorApiConnectionUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(OperatorApiPlanId)) + { + writer.WritePropertyName("operatorApiPlanId"u8); + writer.WriteStringValue(OperatorApiPlanId); + } + if (Optional.IsDefined(PlanTermsAndConditionsAccepted)) + { + writer.WritePropertyName("planTermsAndConditionsAccepted"u8); + writer.WriteBooleanValue(PlanTermsAndConditionsAccepted.Value); + } + if (Optional.IsCollectionDefined(Purposes)) + { + writer.WritePropertyName("purposes"u8); + writer.WriteStartArray(); + foreach (var item in Purposes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PurposeReason)) + { + writer.WritePropertyName("purposeReason"u8); + writer.WriteStringValue(PurposeReason); + } + if (Optional.IsCollectionDefined(DataProcessingList)) + { + writer.WritePropertyName("dataProcessingList"u8); + writer.WriteStartArray(); + foreach (var item in DataProcessingList) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OperatorApiConnectionUpdateProperties 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(OperatorApiConnectionUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperatorApiConnectionUpdateProperties(document.RootElement, options); + } + + internal static OperatorApiConnectionUpdateProperties DeserializeOperatorApiConnectionUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier operatorApiPlanId = default; + bool? planTermsAndConditionsAccepted = default; + IList purposes = default; + string purposeReason = default; + IList dataProcessingList = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("operatorApiPlanId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operatorApiPlanId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("planTermsAndConditionsAccepted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + planTermsAndConditionsAccepted = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("purposes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new Purpose(item.GetString())); + } + purposes = array; + continue; + } + if (property.NameEquals("purposeReason"u8)) + { + purposeReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataProcessingList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataProcessing.DeserializeDataProcessing(item, options)); + } + dataProcessingList = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperatorApiConnectionUpdateProperties( + operatorApiPlanId, + planTermsAndConditionsAccepted, + purposes ?? new ChangeTrackingList(), + purposeReason, + dataProcessingList ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(OperatorApiConnectionUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + OperatorApiConnectionUpdateProperties 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 DeserializeOperatorApiConnectionUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperatorApiConnectionUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionUpdateProperties.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionUpdateProperties.cs new file mode 100644 index 000000000000..905a2a95ec65 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiConnectionUpdateProperties.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// The updatable properties of the OperatorApiConnection. + public partial class OperatorApiConnectionUpdateProperties + { + /// + /// 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 OperatorApiConnectionUpdateProperties() + { + Purposes = new ChangeTrackingList(); + DataProcessingList = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Reference to the Operator API Plan Resource ID. + /// + /// Whether the caller has accepted the Terms and Conditions of the associated Operator API Plan. + /// After creation, the planTermsAndConditionsLink property is set to the Terms and Conditions that + /// have been accepted. + /// + /// Must be set to True, as the Terms and Conditions must be accepted. + /// + /// The purpose for which the Application will use the API. Max Items 1 currently as Operators do not support multiple. + /// Explanation of the reason that justifies the purpose: specifically why is the API used for the application's use case. + /// List of ways the data returned on this API is processed. + /// Keeps track of any properties unknown to the library. + internal OperatorApiConnectionUpdateProperties(ResourceIdentifier operatorApiPlanId, bool? planTermsAndConditionsAccepted, IList purposes, string purposeReason, IList dataProcessingList, IDictionary serializedAdditionalRawData) + { + OperatorApiPlanId = operatorApiPlanId; + PlanTermsAndConditionsAccepted = planTermsAndConditionsAccepted; + Purposes = purposes; + PurposeReason = purposeReason; + DataProcessingList = dataProcessingList; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Reference to the Operator API Plan Resource ID. + public ResourceIdentifier OperatorApiPlanId { get; set; } + /// + /// Whether the caller has accepted the Terms and Conditions of the associated Operator API Plan. + /// After creation, the planTermsAndConditionsLink property is set to the Terms and Conditions that + /// have been accepted. + /// + /// Must be set to True, as the Terms and Conditions must be accepted. + /// + public bool? PlanTermsAndConditionsAccepted { get; set; } + /// The purpose for which the Application will use the API. Max Items 1 currently as Operators do not support multiple. + public IList Purposes { get; } + /// Explanation of the reason that justifies the purpose: specifically why is the API used for the application's use case. + public string PurposeReason { get; set; } + /// List of ways the data returned on this API is processed. + public IList DataProcessingList { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiPlanListResult.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiPlanListResult.Serialization.cs new file mode 100644 index 000000000000..c875bcac5c01 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiPlanListResult.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.ProgrammableConnectivity.Models +{ + internal partial class OperatorApiPlanListResult : 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(OperatorApiPlanListResult)} 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 + } + } + } + + OperatorApiPlanListResult 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(OperatorApiPlanListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperatorApiPlanListResult(document.RootElement, options); + } + + internal static OperatorApiPlanListResult DeserializeOperatorApiPlanListResult(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(OperatorApiPlanData.DeserializeOperatorApiPlanData(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 OperatorApiPlanListResult(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, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(OperatorApiPlanListResult)} does not support writing '{options.Format}' format."); + } + } + + OperatorApiPlanListResult 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 DeserializeOperatorApiPlanListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperatorApiPlanListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiPlanListResult.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiPlanListResult.cs new file mode 100644 index 000000000000..dc93c4054629 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiPlanListResult.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.ProgrammableConnectivity.Models +{ + /// The response of a OperatorApiPlan list operation. + internal partial class OperatorApiPlanListResult + { + /// + /// 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 OperatorApiPlan items on this page. + /// is null. + internal OperatorApiPlanListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The OperatorApiPlan items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal OperatorApiPlanListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OperatorApiPlanListResult() + { + } + + /// The OperatorApiPlan items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiPlanProperties.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiPlanProperties.Serialization.cs new file mode 100644 index 000000000000..66d52a30ffaa --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiPlanProperties.Serialization.cs @@ -0,0 +1,265 @@ +// 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.ProgrammableConnectivity.Models +{ + public partial class OperatorApiPlanProperties : 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(OperatorApiPlanProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(OperatorName)) + { + writer.WritePropertyName("operatorName"u8); + writer.WriteStringValue(OperatorName); + } + if (Optional.IsDefined(CamaraApiName)) + { + writer.WritePropertyName("camaraApiName"u8); + writer.WriteStringValue(CamaraApiName); + } + if (Optional.IsCollectionDefined(SupportedLocations)) + { + writer.WritePropertyName("supportedLocations"u8); + writer.WriteStartArray(); + foreach (var item in SupportedLocations) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(OperatorRegions)) + { + writer.WritePropertyName("operatorRegions"u8); + writer.WriteStartArray(); + foreach (var item in OperatorRegions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Markets)) + { + writer.WritePropertyName("markets"u8); + writer.WriteStartArray(); + foreach (var item in Markets) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Limits)) + { + writer.WritePropertyName("limits"u8); + writer.WriteStringValue(Limits); + } + if (Optional.IsDefined(MarketplaceProperties)) + { + writer.WritePropertyName("marketplaceProperties"u8); + writer.WriteObjectValue(MarketplaceProperties, options); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OperatorApiPlanProperties 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(OperatorApiPlanProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperatorApiPlanProperties(document.RootElement, options); + } + + internal static OperatorApiPlanProperties DeserializeOperatorApiPlanProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string operatorName = default; + string camaraApiName = default; + IReadOnlyList supportedLocations = default; + IReadOnlyList operatorRegions = default; + IReadOnlyList markets = default; + string limits = default; + MarketplaceProperties marketplaceProperties = default; + ProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("operatorName"u8)) + { + operatorName = property.Value.GetString(); + continue; + } + if (property.NameEquals("camaraApiName"u8)) + { + camaraApiName = property.Value.GetString(); + continue; + } + if (property.NameEquals("supportedLocations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + supportedLocations = array; + continue; + } + if (property.NameEquals("operatorRegions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + operatorRegions = array; + continue; + } + if (property.NameEquals("markets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + markets = array; + continue; + } + if (property.NameEquals("limits"u8)) + { + limits = property.Value.GetString(); + continue; + } + if (property.NameEquals("marketplaceProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + marketplaceProperties = MarketplaceProperties.DeserializeMarketplaceProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperatorApiPlanProperties( + operatorName, + camaraApiName, + supportedLocations ?? new ChangeTrackingList(), + operatorRegions ?? new ChangeTrackingList(), + markets ?? new ChangeTrackingList(), + limits, + marketplaceProperties, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(OperatorApiPlanProperties)} does not support writing '{options.Format}' format."); + } + } + + OperatorApiPlanProperties 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 DeserializeOperatorApiPlanProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperatorApiPlanProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiPlanProperties.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiPlanProperties.cs new file mode 100644 index 000000000000..713e8fc899a8 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OperatorApiPlanProperties.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Operator API Plan properties. + public partial class OperatorApiPlanProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal OperatorApiPlanProperties() + { + SupportedLocations = new ChangeTrackingList(); + OperatorRegions = new ChangeTrackingList(); + Markets = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Name of the Operator this plan belongs to. + /// Standardized Network API name defined by CAMARA specifications. + /// List of Azure regions where this offer is supported. + /// List of country/region names where this plan is being supported by the Operator. + /// List of country/region names where this plan is being supported by Azure Marketplace. + /// The limits, if any, will be imposed by the operator. + /// Azure marketplace properties for this plan. + /// The status of the last operation on the Gateway resource. + /// Keeps track of any properties unknown to the library. + internal OperatorApiPlanProperties(string operatorName, string camaraApiName, IReadOnlyList supportedLocations, IReadOnlyList operatorRegions, IReadOnlyList markets, string limits, MarketplaceProperties marketplaceProperties, ProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + OperatorName = operatorName; + CamaraApiName = camaraApiName; + SupportedLocations = supportedLocations; + OperatorRegions = operatorRegions; + Markets = markets; + Limits = limits; + MarketplaceProperties = marketplaceProperties; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the Operator this plan belongs to. + public string OperatorName { get; } + /// Standardized Network API name defined by CAMARA specifications. + public string CamaraApiName { get; } + /// List of Azure regions where this offer is supported. + public IReadOnlyList SupportedLocations { get; } + /// List of country/region names where this plan is being supported by the Operator. + public IReadOnlyList OperatorRegions { get; } + /// List of country/region names where this plan is being supported by Azure Marketplace. + public IReadOnlyList Markets { get; } + /// The limits, if any, will be imposed by the operator. + public string Limits { get; } + /// Azure marketplace properties for this plan. + public MarketplaceProperties MarketplaceProperties { get; } + /// The status of the last operation on the Gateway resource. + public ProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OrganizationType.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OrganizationType.cs new file mode 100644 index 000000000000..adbc4404a3f9 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/OrganizationType.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Valid values for the Organization Type based on W3C Data Privacy Vocabulary v2 https://w3c.github.io/dpv/2.0/dpv/. + public readonly partial struct OrganizationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OrganizationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AcademicScientificOrganizationValue = "Academic scientific organization"; + private const string ForProfitOrganizationValue = "For profit organization"; + private const string GovernmentalOrganizationValue = "Governmental organization"; + private const string IndustryConsortiumValue = "Industry consortium"; + private const string InternationalOrganizationValue = "International organization"; + private const string NonGovernmentalOrganizationValue = "Non-governmental organization"; + private const string NonProfitOrganizationValue = "Non-profit organization"; + private const string OrganizationalUnitValue = "Organizational unit"; + + /// Academic scientific organization. + public static OrganizationType AcademicScientificOrganization { get; } = new OrganizationType(AcademicScientificOrganizationValue); + /// For profit organization. + public static OrganizationType ForProfitOrganization { get; } = new OrganizationType(ForProfitOrganizationValue); + /// Governmental organization. + public static OrganizationType GovernmentalOrganization { get; } = new OrganizationType(GovernmentalOrganizationValue); + /// Industry consortium. + public static OrganizationType IndustryConsortium { get; } = new OrganizationType(IndustryConsortiumValue); + /// International organization. + public static OrganizationType InternationalOrganization { get; } = new OrganizationType(InternationalOrganizationValue); + /// Non-governmental organization. + public static OrganizationType NonGovernmentalOrganization { get; } = new OrganizationType(NonGovernmentalOrganizationValue); + /// Non-profit organization. + public static OrganizationType NonProfitOrganization { get; } = new OrganizationType(NonProfitOrganizationValue); + /// Organizational unit. + public static OrganizationType OrganizationalUnit { get; } = new OrganizationType(OrganizationalUnitValue); + /// Determines if two values are the same. + public static bool operator ==(OrganizationType left, OrganizationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OrganizationType left, OrganizationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OrganizationType(string value) => new OrganizationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OrganizationType other && Equals(other); + /// + public bool Equals(OrganizationType 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Person.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Person.Serialization.cs new file mode 100644 index 000000000000..51244551d9d8 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Person.Serialization.cs @@ -0,0 +1,142 @@ +// 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.ProgrammableConnectivity.Models +{ + public partial class Person : 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(Person)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("familyName"u8); + writer.WriteStringValue(FamilyName); + writer.WritePropertyName("givenName"u8); + writer.WriteStringValue(GivenName); + writer.WritePropertyName("emailAddress"u8); + writer.WriteStringValue(EmailAddress); + 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 + } + } + } + + Person 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(Person)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePerson(document.RootElement, options); + } + + internal static Person DeserializePerson(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string familyName = default; + string givenName = default; + string emailAddress = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("familyName"u8)) + { + familyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("givenName"u8)) + { + givenName = property.Value.GetString(); + continue; + } + if (property.NameEquals("emailAddress"u8)) + { + emailAddress = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Person(familyName, givenName, emailAddress, 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, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(Person)} does not support writing '{options.Format}' format."); + } + } + + Person 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 DeserializePerson(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Person)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Person.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Person.cs new file mode 100644 index 000000000000..24a296791570 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Person.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Model defining a contactable person. + public partial class Person + { + /// + /// 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 . + /// Family name of the contactable person. + /// Given name of the contactable person. + /// Email address of the contactable person. + /// , or is null. + public Person(string familyName, string givenName, string emailAddress) + { + Argument.AssertNotNull(familyName, nameof(familyName)); + Argument.AssertNotNull(givenName, nameof(givenName)); + Argument.AssertNotNull(emailAddress, nameof(emailAddress)); + + FamilyName = familyName; + GivenName = givenName; + EmailAddress = emailAddress; + } + + /// Initializes a new instance of . + /// Family name of the contactable person. + /// Given name of the contactable person. + /// Email address of the contactable person. + /// Keeps track of any properties unknown to the library. + internal Person(string familyName, string givenName, string emailAddress, IDictionary serializedAdditionalRawData) + { + FamilyName = familyName; + GivenName = givenName; + EmailAddress = emailAddress; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Person() + { + } + + /// Family name of the contactable person. + public string FamilyName { get; set; } + /// Given name of the contactable person. + public string GivenName { get; set; } + /// Email address of the contactable person. + public string EmailAddress { get; set; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ProcessingOperation.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ProcessingOperation.cs new file mode 100644 index 000000000000..59f19ae98f56 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ProcessingOperation.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Valid values for the processing operation based on W3C Data Privacy Vocabulary v2 https://w3c.github.io/dpv/2.0/dpv/. + public readonly partial struct ProcessingOperation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProcessingOperation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AccessValue = "Access"; + private const string AcquireValue = "Acquire"; + private const string AdaptValue = "Adapt"; + private const string AggregateValue = "Aggregate"; + private const string AlignValue = "Align"; + private const string AlterValue = "Alter"; + private const string AnalyzeValue = "Analyze"; + private const string AnonymizeValue = "Anonymize"; + private const string AssessValue = "Assess"; + private const string CollectValue = "Collect"; + private const string CombineValue = "Combine"; + private const string ConsultValue = "Consult"; + private const string CopyValue = "Copy"; + private const string CrossBorderTransferValue = "Cross border transfer"; + private const string DeleteValue = "Delete"; + private const string DeriveValue = "Derive"; + private const string DestructValue = "Destruct"; + private const string DiscloseValue = "Disclose"; + private const string DiscloseByTransmissionValue = "Disclose by transmission"; + private const string DisplayValue = "Display"; + private const string DisseminateValue = "Disseminate"; + private const string DownloadValue = "Download"; + private const string EraseValue = "Erase"; + private const string ExportValue = "Export"; + private const string FilterValue = "Filter"; + private const string FormatValue = "Format"; + private const string GenerateValue = "Generate"; + private const string InferValue = "Infer"; + private const string MakeAvailableValue = "Make available"; + private const string MatchValue = "Match"; + private const string ModifyValue = "Modify"; + private const string MonitorValue = "Monitor"; + private const string MoveValue = "Move"; + private const string ObserveValue = "Observe"; + private const string ObtainValue = "Obtain"; + private const string OrganizeValue = "Organize"; + private const string ProfilingValue = "Profiling"; + private const string PseudonymizeValue = "Pseudonymize"; + private const string QueryValue = "Query"; + private const string RecordValue = "Record"; + private const string ReformatValue = "Reformat"; + private const string RemoveValue = "Remove"; + private const string RestrictValue = "Restrict"; + private const string RetrieveValue = "Retrieve"; + private const string ScreenValue = "Screen"; + private const string ShareValue = "Share"; + private const string StoreValue = "Store"; + private const string StructureValue = "Structure"; + private const string TransferValue = "Transfer"; + private const string TransformValue = "Transform"; + private const string TransmitValue = "Transmit"; + private const string UseValue = "Use"; + + /// Access. + public static ProcessingOperation Access { get; } = new ProcessingOperation(AccessValue); + /// Acquire. + public static ProcessingOperation Acquire { get; } = new ProcessingOperation(AcquireValue); + /// Adapt. + public static ProcessingOperation Adapt { get; } = new ProcessingOperation(AdaptValue); + /// Aggregate. + public static ProcessingOperation Aggregate { get; } = new ProcessingOperation(AggregateValue); + /// Align. + public static ProcessingOperation Align { get; } = new ProcessingOperation(AlignValue); + /// Alter. + public static ProcessingOperation Alter { get; } = new ProcessingOperation(AlterValue); + /// Analyze. + public static ProcessingOperation Analyze { get; } = new ProcessingOperation(AnalyzeValue); + /// Anonymize. + public static ProcessingOperation Anonymize { get; } = new ProcessingOperation(AnonymizeValue); + /// Assess. + public static ProcessingOperation Assess { get; } = new ProcessingOperation(AssessValue); + /// Collect. + public static ProcessingOperation Collect { get; } = new ProcessingOperation(CollectValue); + /// Combine. + public static ProcessingOperation Combine { get; } = new ProcessingOperation(CombineValue); + /// Consult. + public static ProcessingOperation Consult { get; } = new ProcessingOperation(ConsultValue); + /// Copy. + public static ProcessingOperation Copy { get; } = new ProcessingOperation(CopyValue); + /// Cross border transfer. + public static ProcessingOperation CrossBorderTransfer { get; } = new ProcessingOperation(CrossBorderTransferValue); + /// Delete. + public static ProcessingOperation Delete { get; } = new ProcessingOperation(DeleteValue); + /// Derive. + public static ProcessingOperation Derive { get; } = new ProcessingOperation(DeriveValue); + /// Destruct. + public static ProcessingOperation Destruct { get; } = new ProcessingOperation(DestructValue); + /// Disclose. + public static ProcessingOperation Disclose { get; } = new ProcessingOperation(DiscloseValue); + /// Disclose by transmission. + public static ProcessingOperation DiscloseByTransmission { get; } = new ProcessingOperation(DiscloseByTransmissionValue); + /// Display. + public static ProcessingOperation Display { get; } = new ProcessingOperation(DisplayValue); + /// Disseminate. + public static ProcessingOperation Disseminate { get; } = new ProcessingOperation(DisseminateValue); + /// Download. + public static ProcessingOperation Download { get; } = new ProcessingOperation(DownloadValue); + /// Erase. + public static ProcessingOperation Erase { get; } = new ProcessingOperation(EraseValue); + /// Export. + public static ProcessingOperation Export { get; } = new ProcessingOperation(ExportValue); + /// Filter. + public static ProcessingOperation Filter { get; } = new ProcessingOperation(FilterValue); + /// Format. + public static ProcessingOperation Format { get; } = new ProcessingOperation(FormatValue); + /// Generate. + public static ProcessingOperation Generate { get; } = new ProcessingOperation(GenerateValue); + /// Infer. + public static ProcessingOperation Infer { get; } = new ProcessingOperation(InferValue); + /// Make available. + public static ProcessingOperation MakeAvailable { get; } = new ProcessingOperation(MakeAvailableValue); + /// Match. + public static ProcessingOperation Match { get; } = new ProcessingOperation(MatchValue); + /// Modify. + public static ProcessingOperation Modify { get; } = new ProcessingOperation(ModifyValue); + /// Monitor. + public static ProcessingOperation Monitor { get; } = new ProcessingOperation(MonitorValue); + /// Move. + public static ProcessingOperation Move { get; } = new ProcessingOperation(MoveValue); + /// Observe. + public static ProcessingOperation Observe { get; } = new ProcessingOperation(ObserveValue); + /// Obtain. + public static ProcessingOperation Obtain { get; } = new ProcessingOperation(ObtainValue); + /// Organize. + public static ProcessingOperation Organize { get; } = new ProcessingOperation(OrganizeValue); + /// Profiling. + public static ProcessingOperation Profiling { get; } = new ProcessingOperation(ProfilingValue); + /// Pseudonymize. + public static ProcessingOperation Pseudonymize { get; } = new ProcessingOperation(PseudonymizeValue); + /// Query. + public static ProcessingOperation Query { get; } = new ProcessingOperation(QueryValue); + /// Record. + public static ProcessingOperation Record { get; } = new ProcessingOperation(RecordValue); + /// Reformat. + public static ProcessingOperation Reformat { get; } = new ProcessingOperation(ReformatValue); + /// Remove. + public static ProcessingOperation Remove { get; } = new ProcessingOperation(RemoveValue); + /// Restrict. + public static ProcessingOperation Restrict { get; } = new ProcessingOperation(RestrictValue); + /// Retrieve. + public static ProcessingOperation Retrieve { get; } = new ProcessingOperation(RetrieveValue); + /// Screen. + public static ProcessingOperation Screen { get; } = new ProcessingOperation(ScreenValue); + /// Share. + public static ProcessingOperation Share { get; } = new ProcessingOperation(ShareValue); + /// Store. + public static ProcessingOperation Store { get; } = new ProcessingOperation(StoreValue); + /// Structure. + public static ProcessingOperation Structure { get; } = new ProcessingOperation(StructureValue); + /// Transfer. + public static ProcessingOperation Transfer { get; } = new ProcessingOperation(TransferValue); + /// Transform. + public static ProcessingOperation Transform { get; } = new ProcessingOperation(TransformValue); + /// Transmit. + public static ProcessingOperation Transmit { get; } = new ProcessingOperation(TransmitValue); + /// Use. + public static ProcessingOperation Use { get; } = new ProcessingOperation(UseValue); + /// Determines if two values are the same. + public static bool operator ==(ProcessingOperation left, ProcessingOperation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProcessingOperation left, ProcessingOperation right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProcessingOperation(string value) => new ProcessingOperation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProcessingOperation other && Equals(other); + /// + public bool Equals(ProcessingOperation 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ProvisioningState.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..5c3b146f2892 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/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.ProgrammableConnectivity.Models +{ + /// The provisioning state of a resource. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + + /// Resource has been created. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Resource creation failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// The resource is being provisioned. + public static ProvisioningState Provisioning { get; } = new ProvisioningState(ProvisioningValue); + /// The resource is updating. + public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); + /// The resource is being deleted. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// The resource create or update 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Purpose.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Purpose.cs new file mode 100644 index 000000000000..5a7fe67c4d52 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Purpose.cs @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Valid values for the purpose based on W3C Data Privacy Vocabulary v2 https://w3c.github.io/dpv/2.0/dpv/. + public readonly partial struct Purpose : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Purpose(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AcademicResearchValue = "Academic Research"; + private const string AccountManagementValue = "Account Management"; + private const string AdvertisingValue = "Advertising"; + private const string AgeVerificationValue = "Age Verification"; + private const string CombatClimateChangeValue = "Combat Climate Change"; + private const string CommercialPurposeValue = "Commercial Purpose"; + private const string CommercialResearchValue = "Commercial Research"; + private const string CommunicationForCustomerCareValue = "Communication For Customer Care"; + private const string CommunicationManagementValue = "Communication Management"; + private const string CounterMoneyLaunderingValue = "Counter Money Laundering"; + private const string CounterterrorismValue = "Counter-terrorism"; + private const string CreditCheckingValue = "Credit Checking"; + private const string CustomerCareValue = "Customer Care"; + private const string CustomerClaimsManagementValue = "Customer Claims Management"; + private const string CustomerManagementValue = "Customer Management"; + private const string CustomerOrderManagementValue = "Customer Order Management"; + private const string CustomerRelationshipManagementValue = "Customer Relationship Management"; + private const string CustomerSolvencyMonitoringValue = "Customer Solvency Monitoring"; + private const string DataAltruismValue = "Data Altruism"; + private const string DeliveryOfGoodsValue = "Delivery Of Goods"; + private const string DirectMarketingValue = "Direct Marketing"; + private const string DisputeManagementValue = "Dispute Management"; + private const string EnforceAccessControlValue = "Enforce Access Control"; + private const string EnforceSecurityValue = "Enforce Security"; + private const string EstablishContractualAgreementValue = "Establish Contractual Agreement"; + private const string FraudPreventionAndDetectionValue = "Fraud Prevention And Detection"; + private const string FulfillmentOfContractualObligationValue = "Fulfillment Of Contractual Obligation"; + private const string FulfillmentOfObligationValue = "Fulfillment Of Obligation"; + private const string HumanResourceManagementValue = "Human Resource Management"; + private const string IdentityAuthenticationValue = "Identity Authentication"; + private const string IdentityVerificationValue = "Identity Verification"; + private const string ImproveExistingProductsAndServicesValue = "Improve Existing Products And Services"; + private const string ImproveHealthcareValue = "Improve Healthcare"; + private const string ImproveInternalCRMProcessesValue = "Improve Internal CRM Processes"; + private const string ImprovePublicServicesValue = "Improve Public Services"; + private const string ImproveTransportMobilityValue = "Improve Transport Mobility"; + private const string IncreaseServiceRobustnessValue = "Increase Service Robustness"; + private const string InternalResourceOptimizationValue = "Internal Resource Optimization"; + private const string LegalComplianceValue = "Legal Compliance"; + private const string MaintainCreditCheckingDatabaseValue = "Maintain Credit Checking Database"; + private const string MaintainCreditRatingDatabaseValue = "Maintain Credit Rating Database"; + private const string MaintainFraudDatabaseValue = "Maintain Fraud Database"; + private const string MarketingValue = "Marketing"; + private const string MemberPartnerManagementValue = "Member Partner Management"; + private const string MisusePreventionAndDetectionValue = "Misuse Prevention And Detection"; + private const string NonCommercialPurposeValue = "Non Commercial Purpose"; + private const string NonCommercialResearchValue = "Non Commercial Research"; + private const string OptimizationForConsumerValue = "Optimization For Consumer"; + private const string OptimizationForControllerValue = "Optimization For Controller"; + private const string OptimizeUserInterfaceValue = "Optimize User Interface"; + private const string OrganizationComplianceManagementValue = "Organization Compliance Management"; + private const string OrganizationGovernanceValue = "Organization Governance"; + private const string OrganizationRiskManagementValue = "Organization Risk Management"; + private const string PaymentManagementValue = "Payment Management"; + private const string PersonalizationValue = "Personalization"; + private const string PersonalizedAdvertisingValue = "Personalized Advertising"; + private const string PersonalizedBenefitsValue = "Personalized Benefits"; + private const string PersonnelHiringValue = "Personnel Hiring"; + private const string PersonnelManagementValue = "Personnel Management"; + private const string PersonnelPaymentValue = "Personnel Payment"; + private const string ProtectionOfIPRValue = "Protection Of IPR"; + private const string ProtectionOfNationalSecurityValue = "Protection Of National Security"; + private const string ProtectionOfPublicSecurityValue = "Protection Of Public Security"; + private const string ProvideEventRecommendationsValue = "Provide Event Recommendations"; + private const string ProvideOfficialStatisticsValue = "Provide Official Statistics"; + private const string ProvidePersonalizedRecommendationsValue = "Provide Personalized Recommendations"; + private const string ProvideProductRecommendationsValue = "Provide Product Recommendations"; + private const string PublicBenefitValue = "Public Benefit"; + private const string PublicPolicyMakingValue = "Public Policy Making"; + private const string PublicRelationsValue = "Public Relations"; + private const string RecordManagementValue = "Record Management"; + private const string RepairImpairmentsValue = "Repair Impairments"; + private const string RequestedServiceProvisionValue = "Requested Service Provision"; + private const string ResearchAndDevelopmentValue = "Research And Development"; + private const string RightsFulfillmentValue = "Rights Fulfillment"; + private const string ScientificResearchValue = "Scientific Research"; + private const string SearchFunctionalitiesValue = "Search Functionalities"; + private const string SellDataToThirdPartiesValue = "Sell Data To Third Parties"; + private const string SellInsightsFromDataValue = "Sell Insights From Data"; + private const string SellProductsValue = "Sell Products"; + private const string SellProductsToDataSubjectValue = "Sell Products To Data Subject"; + private const string ServiceoptimizationValue = "Service Optimization"; + private const string ServicePersonalizationValue = "Service Personalization"; + private const string ServiceProvisionValue = "Service Provision"; + private const string ServiceRegistrationValue = "Service Registration"; + private const string ServiceUsageAnalyticsValue = "Service Usage Analytics"; + private const string SocialMediaMarketingValue = "Social Media Marketing"; + private const string TargetedAdvertisingValue = "Targeted Advertising"; + private const string TechnicalServiceProvisionValue = "Technical Service Provision"; + private const string UserInterfacePersonalizationValue = "User Interface Personalization"; + private const string VendorManagementValue = "Vendor Management"; + private const string VendorPaymentValue = "Vendor Payment"; + private const string VendorRecordsManagementValue = "Vendor Records Management"; + private const string VendorSelectionAssessmentValue = "Vendor Selection Assessment"; + private const string VerificationValue = "Verification"; + + /// Academic Research. + public static Purpose AcademicResearch { get; } = new Purpose(AcademicResearchValue); + /// Account Management. + public static Purpose AccountManagement { get; } = new Purpose(AccountManagementValue); + /// Advertising. + public static Purpose Advertising { get; } = new Purpose(AdvertisingValue); + /// Age Verification. + public static Purpose AgeVerification { get; } = new Purpose(AgeVerificationValue); + /// Combat Climate Change. + public static Purpose CombatClimateChange { get; } = new Purpose(CombatClimateChangeValue); + /// Commercial Purpose. + public static Purpose CommercialPurpose { get; } = new Purpose(CommercialPurposeValue); + /// Commercial Research. + public static Purpose CommercialResearch { get; } = new Purpose(CommercialResearchValue); + /// Communication For Customer Care. + public static Purpose CommunicationForCustomerCare { get; } = new Purpose(CommunicationForCustomerCareValue); + /// Communication Management. + public static Purpose CommunicationManagement { get; } = new Purpose(CommunicationManagementValue); + /// Counter Money Laundering. + public static Purpose CounterMoneyLaundering { get; } = new Purpose(CounterMoneyLaunderingValue); + /// Counter-terrorism. + public static Purpose Counterterrorism { get; } = new Purpose(CounterterrorismValue); + /// Credit Checking. + public static Purpose CreditChecking { get; } = new Purpose(CreditCheckingValue); + /// Customer Care. + public static Purpose CustomerCare { get; } = new Purpose(CustomerCareValue); + /// Customer Claims Management. + public static Purpose CustomerClaimsManagement { get; } = new Purpose(CustomerClaimsManagementValue); + /// Customer Management. + public static Purpose CustomerManagement { get; } = new Purpose(CustomerManagementValue); + /// Customer Order Management. + public static Purpose CustomerOrderManagement { get; } = new Purpose(CustomerOrderManagementValue); + /// Customer Relationship Management. + public static Purpose CustomerRelationshipManagement { get; } = new Purpose(CustomerRelationshipManagementValue); + /// Customer Solvency Monitoring. + public static Purpose CustomerSolvencyMonitoring { get; } = new Purpose(CustomerSolvencyMonitoringValue); + /// Data Altruism. + public static Purpose DataAltruism { get; } = new Purpose(DataAltruismValue); + /// Delivery Of Goods. + public static Purpose DeliveryOfGoods { get; } = new Purpose(DeliveryOfGoodsValue); + /// Direct Marketing. + public static Purpose DirectMarketing { get; } = new Purpose(DirectMarketingValue); + /// Dispute Management. + public static Purpose DisputeManagement { get; } = new Purpose(DisputeManagementValue); + /// Enforce Access Control. + public static Purpose EnforceAccessControl { get; } = new Purpose(EnforceAccessControlValue); + /// Enforce Security. + public static Purpose EnforceSecurity { get; } = new Purpose(EnforceSecurityValue); + /// Establish Contractual Agreement. + public static Purpose EstablishContractualAgreement { get; } = new Purpose(EstablishContractualAgreementValue); + /// Fraud Prevention And Detection. + public static Purpose FraudPreventionAndDetection { get; } = new Purpose(FraudPreventionAndDetectionValue); + /// Fulfillment Of Contractual Obligation. + public static Purpose FulfillmentOfContractualObligation { get; } = new Purpose(FulfillmentOfContractualObligationValue); + /// Fulfillment Of Obligation. + public static Purpose FulfillmentOfObligation { get; } = new Purpose(FulfillmentOfObligationValue); + /// Human Resource Management. + public static Purpose HumanResourceManagement { get; } = new Purpose(HumanResourceManagementValue); + /// Identity Authentication. + public static Purpose IdentityAuthentication { get; } = new Purpose(IdentityAuthenticationValue); + /// Identity Verification. + public static Purpose IdentityVerification { get; } = new Purpose(IdentityVerificationValue); + /// Improve Existing Products And Services. + public static Purpose ImproveExistingProductsAndServices { get; } = new Purpose(ImproveExistingProductsAndServicesValue); + /// Improve Healthcare. + public static Purpose ImproveHealthcare { get; } = new Purpose(ImproveHealthcareValue); + /// Improve Internal CRM Processes. + public static Purpose ImproveInternalCRMProcesses { get; } = new Purpose(ImproveInternalCRMProcessesValue); + /// Improve Public Services. + public static Purpose ImprovePublicServices { get; } = new Purpose(ImprovePublicServicesValue); + /// Improve Transport Mobility. + public static Purpose ImproveTransportMobility { get; } = new Purpose(ImproveTransportMobilityValue); + /// Increase Service Robustness. + public static Purpose IncreaseServiceRobustness { get; } = new Purpose(IncreaseServiceRobustnessValue); + /// Internal Resource Optimization. + public static Purpose InternalResourceOptimization { get; } = new Purpose(InternalResourceOptimizationValue); + /// Legal Compliance. + public static Purpose LegalCompliance { get; } = new Purpose(LegalComplianceValue); + /// Maintain Credit Checking Database. + public static Purpose MaintainCreditCheckingDatabase { get; } = new Purpose(MaintainCreditCheckingDatabaseValue); + /// Maintain Credit Rating Database. + public static Purpose MaintainCreditRatingDatabase { get; } = new Purpose(MaintainCreditRatingDatabaseValue); + /// Maintain Fraud Database. + public static Purpose MaintainFraudDatabase { get; } = new Purpose(MaintainFraudDatabaseValue); + /// Marketing. + public static Purpose Marketing { get; } = new Purpose(MarketingValue); + /// Member Partner Management. + public static Purpose MemberPartnerManagement { get; } = new Purpose(MemberPartnerManagementValue); + /// Misuse Prevention And Detection. + public static Purpose MisusePreventionAndDetection { get; } = new Purpose(MisusePreventionAndDetectionValue); + /// Non Commercial Purpose. + public static Purpose NonCommercialPurpose { get; } = new Purpose(NonCommercialPurposeValue); + /// Non Commercial Research. + public static Purpose NonCommercialResearch { get; } = new Purpose(NonCommercialResearchValue); + /// Optimization For Consumer. + public static Purpose OptimizationForConsumer { get; } = new Purpose(OptimizationForConsumerValue); + /// Optimization For Controller. + public static Purpose OptimizationForController { get; } = new Purpose(OptimizationForControllerValue); + /// Optimize User Interface. + public static Purpose OptimizeUserInterface { get; } = new Purpose(OptimizeUserInterfaceValue); + /// Organization Compliance Management. + public static Purpose OrganizationComplianceManagement { get; } = new Purpose(OrganizationComplianceManagementValue); + /// Organization Governance. + public static Purpose OrganizationGovernance { get; } = new Purpose(OrganizationGovernanceValue); + /// Organization Risk Management. + public static Purpose OrganizationRiskManagement { get; } = new Purpose(OrganizationRiskManagementValue); + /// Payment Management. + public static Purpose PaymentManagement { get; } = new Purpose(PaymentManagementValue); + /// Personalization. + public static Purpose Personalization { get; } = new Purpose(PersonalizationValue); + /// Personalized Advertising. + public static Purpose PersonalizedAdvertising { get; } = new Purpose(PersonalizedAdvertisingValue); + /// Personalized Benefits. + public static Purpose PersonalizedBenefits { get; } = new Purpose(PersonalizedBenefitsValue); + /// Personnel Hiring. + public static Purpose PersonnelHiring { get; } = new Purpose(PersonnelHiringValue); + /// Personnel Management. + public static Purpose PersonnelManagement { get; } = new Purpose(PersonnelManagementValue); + /// Personnel Payment. + public static Purpose PersonnelPayment { get; } = new Purpose(PersonnelPaymentValue); + /// Protection Of IPR. + public static Purpose ProtectionOfIPR { get; } = new Purpose(ProtectionOfIPRValue); + /// Protection Of National Security. + public static Purpose ProtectionOfNationalSecurity { get; } = new Purpose(ProtectionOfNationalSecurityValue); + /// Protection Of Public Security. + public static Purpose ProtectionOfPublicSecurity { get; } = new Purpose(ProtectionOfPublicSecurityValue); + /// Provide Event Recommendations. + public static Purpose ProvideEventRecommendations { get; } = new Purpose(ProvideEventRecommendationsValue); + /// Provide Official Statistics. + public static Purpose ProvideOfficialStatistics { get; } = new Purpose(ProvideOfficialStatisticsValue); + /// Provide Personalized Recommendations. + public static Purpose ProvidePersonalizedRecommendations { get; } = new Purpose(ProvidePersonalizedRecommendationsValue); + /// Provide Product Recommendations. + public static Purpose ProvideProductRecommendations { get; } = new Purpose(ProvideProductRecommendationsValue); + /// Public Benefit. + public static Purpose PublicBenefit { get; } = new Purpose(PublicBenefitValue); + /// Public Policy Making. + public static Purpose PublicPolicyMaking { get; } = new Purpose(PublicPolicyMakingValue); + /// Public Relations. + public static Purpose PublicRelations { get; } = new Purpose(PublicRelationsValue); + /// Record Management. + public static Purpose RecordManagement { get; } = new Purpose(RecordManagementValue); + /// Repair Impairments. + public static Purpose RepairImpairments { get; } = new Purpose(RepairImpairmentsValue); + /// Requested Service Provision. + public static Purpose RequestedServiceProvision { get; } = new Purpose(RequestedServiceProvisionValue); + /// Research And Development. + public static Purpose ResearchAndDevelopment { get; } = new Purpose(ResearchAndDevelopmentValue); + /// Rights Fulfillment. + public static Purpose RightsFulfillment { get; } = new Purpose(RightsFulfillmentValue); + /// Scientific Research. + public static Purpose ScientificResearch { get; } = new Purpose(ScientificResearchValue); + /// Search Functionalities. + public static Purpose SearchFunctionalities { get; } = new Purpose(SearchFunctionalitiesValue); + /// Sell Data To Third Parties. + public static Purpose SellDataToThirdParties { get; } = new Purpose(SellDataToThirdPartiesValue); + /// Sell Insights From Data. + public static Purpose SellInsightsFromData { get; } = new Purpose(SellInsightsFromDataValue); + /// Sell Products. + public static Purpose SellProducts { get; } = new Purpose(SellProductsValue); + /// Sell Products To Data Subject. + public static Purpose SellProductsToDataSubject { get; } = new Purpose(SellProductsToDataSubjectValue); + /// Service Optimization. + public static Purpose Serviceoptimization { get; } = new Purpose(ServiceoptimizationValue); + /// Service Personalization. + public static Purpose ServicePersonalization { get; } = new Purpose(ServicePersonalizationValue); + /// Service Provision. + public static Purpose ServiceProvision { get; } = new Purpose(ServiceProvisionValue); + /// Service Registration. + public static Purpose ServiceRegistration { get; } = new Purpose(ServiceRegistrationValue); + /// Service Usage Analytics. + public static Purpose ServiceUsageAnalytics { get; } = new Purpose(ServiceUsageAnalyticsValue); + /// Social Media Marketing. + public static Purpose SocialMediaMarketing { get; } = new Purpose(SocialMediaMarketingValue); + /// Targeted Advertising. + public static Purpose TargetedAdvertising { get; } = new Purpose(TargetedAdvertisingValue); + /// Technical Service Provision. + public static Purpose TechnicalServiceProvision { get; } = new Purpose(TechnicalServiceProvisionValue); + /// User Interface Personalization. + public static Purpose UserInterfacePersonalization { get; } = new Purpose(UserInterfacePersonalizationValue); + /// Vendor Management. + public static Purpose VendorManagement { get; } = new Purpose(VendorManagementValue); + /// Vendor Payment. + public static Purpose VendorPayment { get; } = new Purpose(VendorPaymentValue); + /// Vendor Records Management. + public static Purpose VendorRecordsManagement { get; } = new Purpose(VendorRecordsManagementValue); + /// Vendor Selection Assessment. + public static Purpose VendorSelectionAssessment { get; } = new Purpose(VendorSelectionAssessmentValue); + /// Verification. + public static Purpose Verification { get; } = new Purpose(VerificationValue); + /// Determines if two values are the same. + public static bool operator ==(Purpose left, Purpose right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Purpose left, Purpose right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Purpose(string value) => new Purpose(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Purpose other && Equals(other); + /// + public bool Equals(Purpose 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Status.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Status.Serialization.cs new file mode 100644 index 000000000000..33228c34b19d --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Status.Serialization.cs @@ -0,0 +1,140 @@ +// 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.ProgrammableConnectivity.Models +{ + public partial class Status : 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(Status)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State); + } + if (Optional.IsDefined(Reason)) + { + writer.WritePropertyName("reason"u8); + writer.WriteStringValue(Reason); + } + 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 + } + } + } + + Status 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(Status)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStatus(document.RootElement, options); + } + + internal static Status DeserializeStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string state = default; + string reason = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("state"u8)) + { + state = property.Value.GetString(); + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Status(state, reason, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(Status)} does not support writing '{options.Format}' format."); + } + } + + Status 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 DeserializeStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Status)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Status.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Status.cs new file mode 100644 index 000000000000..bf26765bd226 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/Models/Status.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Models +{ + /// Description of the current status of the OperatorApiConnection resource. + public partial class Status + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal Status() + { + } + + /// Initializes a new instance of . + /// Current state of the OperatorApiConnection resource. + /// Explanation of the current state of the OperatorApiConnection resource. + /// Keeps track of any properties unknown to the library. + internal Status(string state, string reason, IDictionary serializedAdditionalRawData) + { + State = state; + Reason = reason; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Current state of the OperatorApiConnection resource. + public string State { get; } + /// Explanation of the current state of the OperatorApiConnection resource. + public string Reason { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiConnectionCollection.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiConnectionCollection.cs new file mode 100644 index 000000000000..aa829ee4886c --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiConnectionCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetOperatorApiConnections method from an instance of . + /// + public partial class OperatorApiConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _operatorApiConnectionClientDiagnostics; + private readonly OperatorApiConnectionsRestOperations _operatorApiConnectionRestClient; + + /// Initializes a new instance of the class for mocking. + protected OperatorApiConnectionCollection() + { + } + + /// 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 OperatorApiConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _operatorApiConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ProgrammableConnectivity", OperatorApiConnectionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(OperatorApiConnectionResource.ResourceType, out string operatorApiConnectionApiVersion); + _operatorApiConnectionRestClient = new OperatorApiConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, operatorApiConnectionApiVersion); +#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 an Operator API Connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Create + /// + /// + /// Default Api Version + /// 2025-03-30-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. + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// 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 operatorApiConnectionName, OperatorApiConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _operatorApiConnectionRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, operatorApiConnectionName, data, cancellationToken).ConfigureAwait(false); + var operation = new ProgrammableConnectivityArmOperation(new OperatorApiConnectionOperationSource(Client), _operatorApiConnectionClientDiagnostics, Pipeline, _operatorApiConnectionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, operatorApiConnectionName, 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 an Operator API Connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Create + /// + /// + /// Default Api Version + /// 2025-03-30-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. + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// 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 operatorApiConnectionName, OperatorApiConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _operatorApiConnectionRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, operatorApiConnectionName, data, cancellationToken); + var operation = new ProgrammableConnectivityArmOperation(new OperatorApiConnectionOperationSource(Client), _operatorApiConnectionClientDiagnostics, Pipeline, _operatorApiConnectionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, operatorApiConnectionName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an Operator API Connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string operatorApiConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + + using var scope = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionCollection.Get"); + scope.Start(); + try + { + var response = await _operatorApiConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, operatorApiConnectionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new OperatorApiConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an Operator API Connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string operatorApiConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + + using var scope = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionCollection.Get"); + scope.Start(); + try + { + var response = _operatorApiConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, operatorApiConnectionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new OperatorApiConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List OperatorApiConnection resources by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections + /// + /// + /// Operation Id + /// OperatorApiConnection_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-30-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) => _operatorApiConnectionRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _operatorApiConnectionRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OperatorApiConnectionResource(Client, OperatorApiConnectionData.DeserializeOperatorApiConnectionData(e)), _operatorApiConnectionClientDiagnostics, Pipeline, "OperatorApiConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List OperatorApiConnection resources by resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections + /// + /// + /// Operation Id + /// OperatorApiConnection_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-30-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) => _operatorApiConnectionRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _operatorApiConnectionRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OperatorApiConnectionResource(Client, OperatorApiConnectionData.DeserializeOperatorApiConnectionData(e)), _operatorApiConnectionClientDiagnostics, Pipeline, "OperatorApiConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string operatorApiConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + + using var scope = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionCollection.Exists"); + scope.Start(); + try + { + var response = await _operatorApiConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, operatorApiConnectionName, 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.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string operatorApiConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + + using var scope = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionCollection.Exists"); + scope.Start(); + try + { + var response = _operatorApiConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, operatorApiConnectionName, 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.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string operatorApiConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + + using var scope = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _operatorApiConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, operatorApiConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new OperatorApiConnectionResource(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.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string operatorApiConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + + using var scope = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _operatorApiConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, operatorApiConnectionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new OperatorApiConnectionResource(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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiConnectionData.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiConnectionData.Serialization.cs new file mode 100644 index 000000000000..7584fb9d8cf9 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiConnectionData.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.ProgrammableConnectivity.Models; + +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + public partial class OperatorApiConnectionData : 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(OperatorApiConnectionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + OperatorApiConnectionData 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(OperatorApiConnectionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperatorApiConnectionData(document.RootElement, options); + } + + internal static OperatorApiConnectionData DeserializeOperatorApiConnectionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OperatorApiConnectionProperties properties = 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 = OperatorApiConnectionProperties.DeserializeOperatorApiConnectionProperties(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperatorApiConnectionData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(OperatorApiConnectionData)} does not support writing '{options.Format}' format."); + } + } + + OperatorApiConnectionData 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 DeserializeOperatorApiConnectionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperatorApiConnectionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiConnectionData.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiConnectionData.cs new file mode 100644 index 000000000000..8be82f7da975 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiConnectionData.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.ProgrammableConnectivity.Models; + +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + /// + /// A class representing the OperatorApiConnection data model. + /// A Programmable Connectivity Operator API Connection resource + /// + public partial class OperatorApiConnectionData : 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 OperatorApiConnectionData(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. + /// Keeps track of any properties unknown to the library. + internal OperatorApiConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, OperatorApiConnectionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OperatorApiConnectionData() + { + } + + /// The resource-specific properties for this resource. + public OperatorApiConnectionProperties Properties { get; set; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiConnectionResource.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiConnectionResource.Serialization.cs new file mode 100644 index 000000000000..2fcda05f344a --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiConnectionResource.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.ProgrammableConnectivity +{ + public partial class OperatorApiConnectionResource : IJsonModel + { + private static OperatorApiConnectionData s_dataDeserializationInstance; + private static OperatorApiConnectionData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + OperatorApiConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerProgrammableConnectivityContext.Default); + + OperatorApiConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerProgrammableConnectivityContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiConnectionResource.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiConnectionResource.cs new file mode 100644 index 000000000000..db5df526f05a --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiConnectionResource.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.ProgrammableConnectivity.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + /// + /// A Class representing an OperatorApiConnection along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetOperatorApiConnectionResource method. + /// Otherwise you can get one from its parent resource using the GetOperatorApiConnection method. + /// + public partial class OperatorApiConnectionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The operatorApiConnectionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string operatorApiConnectionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _operatorApiConnectionClientDiagnostics; + private readonly OperatorApiConnectionsRestOperations _operatorApiConnectionRestClient; + private readonly OperatorApiConnectionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ProgrammableConnectivity/operatorApiConnections"; + + /// Initializes a new instance of the class for mocking. + protected OperatorApiConnectionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal OperatorApiConnectionResource(ArmClient client, OperatorApiConnectionData 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 OperatorApiConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _operatorApiConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ProgrammableConnectivity", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string operatorApiConnectionApiVersion); + _operatorApiConnectionRestClient = new OperatorApiConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, operatorApiConnectionApiVersion); +#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 OperatorApiConnectionData 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 an Operator API Connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionResource.Get"); + scope.Start(); + try + { + var response = await _operatorApiConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new OperatorApiConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an Operator API Connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionResource.Get"); + scope.Start(); + try + { + var response = _operatorApiConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new OperatorApiConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete an Operator API Connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Delete + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionResource.Delete"); + scope.Start(); + try + { + var response = await _operatorApiConnectionRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ProgrammableConnectivityArmOperation(_operatorApiConnectionClientDiagnostics, Pipeline, _operatorApiConnectionRestClient.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 an Operator API Connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Delete + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionResource.Delete"); + scope.Start(); + try + { + var response = _operatorApiConnectionRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ProgrammableConnectivityArmOperation(_operatorApiConnectionClientDiagnostics, Pipeline, _operatorApiConnectionRestClient.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 an Operator API Connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Update + /// + /// + /// Default Api Version + /// 2025-03-30-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, OperatorApiConnectionPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionResource.Update"); + scope.Start(); + try + { + var response = await _operatorApiConnectionRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ProgrammableConnectivityArmOperation(new OperatorApiConnectionOperationSource(Client), _operatorApiConnectionClientDiagnostics, Pipeline, _operatorApiConnectionRestClient.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 an Operator API Connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Update + /// + /// + /// Default Api Version + /// 2025-03-30-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, OperatorApiConnectionPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionResource.Update"); + scope.Start(); + try + { + var response = _operatorApiConnectionRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new ProgrammableConnectivityArmOperation(new OperatorApiConnectionOperationSource(Client), _operatorApiConnectionClientDiagnostics, Pipeline, _operatorApiConnectionRestClient.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.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionResource.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 _operatorApiConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new OperatorApiConnectionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new OperatorApiConnectionPatch(); + 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.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionResource.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 = _operatorApiConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new OperatorApiConnectionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new OperatorApiConnectionPatch(); + 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.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionResource.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 _operatorApiConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new OperatorApiConnectionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new OperatorApiConnectionPatch(); + 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.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionResource.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 = _operatorApiConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new OperatorApiConnectionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new OperatorApiConnectionPatch(); + 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.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionResource.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 _operatorApiConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new OperatorApiConnectionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new OperatorApiConnectionPatch(); + 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.ProgrammableConnectivity/operatorApiConnections/{operatorApiConnectionName} + /// + /// + /// Operation Id + /// OperatorApiConnection_Get + /// + /// + /// Default Api Version + /// 2025-03-30-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 = _operatorApiConnectionClientDiagnostics.CreateScope("OperatorApiConnectionResource.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 = _operatorApiConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new OperatorApiConnectionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new OperatorApiConnectionPatch(); + 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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiPlanCollection.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiPlanCollection.cs new file mode 100644 index 000000000000..cb0305eeaf60 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiPlanCollection.cs @@ -0,0 +1,402 @@ +// 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.ProgrammableConnectivity +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetOperatorApiPlans method from an instance of . + /// + public partial class OperatorApiPlanCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _operatorApiPlanClientDiagnostics; + private readonly OperatorApiPlansRestOperations _operatorApiPlanRestClient; + + /// Initializes a new instance of the class for mocking. + protected OperatorApiPlanCollection() + { + } + + /// 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 OperatorApiPlanCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _operatorApiPlanClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ProgrammableConnectivity", OperatorApiPlanResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(OperatorApiPlanResource.ResourceType, out string operatorApiPlanApiVersion); + _operatorApiPlanRestClient = new OperatorApiPlansRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, operatorApiPlanApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Get an OperatorApiPlan resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/{operatorApiPlanName} + /// + /// + /// Operation Id + /// OperatorApiPlan_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// APC Gateway Plan Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string operatorApiPlanName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operatorApiPlanName, nameof(operatorApiPlanName)); + + using var scope = _operatorApiPlanClientDiagnostics.CreateScope("OperatorApiPlanCollection.Get"); + scope.Start(); + try + { + var response = await _operatorApiPlanRestClient.GetAsync(Id.SubscriptionId, operatorApiPlanName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new OperatorApiPlanResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an OperatorApiPlan resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/{operatorApiPlanName} + /// + /// + /// Operation Id + /// OperatorApiPlan_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// APC Gateway Plan Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string operatorApiPlanName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operatorApiPlanName, nameof(operatorApiPlanName)); + + using var scope = _operatorApiPlanClientDiagnostics.CreateScope("OperatorApiPlanCollection.Get"); + scope.Start(); + try + { + var response = _operatorApiPlanRestClient.Get(Id.SubscriptionId, operatorApiPlanName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new OperatorApiPlanResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List OperatorApiPlan resources by subscription ID. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans + /// + /// + /// Operation Id + /// OperatorApiPlan_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// An optional OData based filter expression to apply on the operation. + /// An optional query parameter which specifies the maximum number of records to be returned. + /// An optional query parameter which specifies the number of records to be skipped. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string filter = null, int? top = null, int? skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _operatorApiPlanRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _operatorApiPlanRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top, skip); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OperatorApiPlanResource(Client, OperatorApiPlanData.DeserializeOperatorApiPlanData(e)), _operatorApiPlanClientDiagnostics, Pipeline, "OperatorApiPlanCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List OperatorApiPlan resources by subscription ID. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans + /// + /// + /// Operation Id + /// OperatorApiPlan_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// An optional OData based filter expression to apply on the operation. + /// An optional query parameter which specifies the maximum number of records to be returned. + /// An optional query parameter which specifies the number of records to be skipped. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string filter = null, int? top = null, int? skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _operatorApiPlanRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, top, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _operatorApiPlanRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, top, skip); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OperatorApiPlanResource(Client, OperatorApiPlanData.DeserializeOperatorApiPlanData(e)), _operatorApiPlanClientDiagnostics, Pipeline, "OperatorApiPlanCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/{operatorApiPlanName} + /// + /// + /// Operation Id + /// OperatorApiPlan_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// APC Gateway Plan Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string operatorApiPlanName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operatorApiPlanName, nameof(operatorApiPlanName)); + + using var scope = _operatorApiPlanClientDiagnostics.CreateScope("OperatorApiPlanCollection.Exists"); + scope.Start(); + try + { + var response = await _operatorApiPlanRestClient.GetAsync(Id.SubscriptionId, operatorApiPlanName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/{operatorApiPlanName} + /// + /// + /// Operation Id + /// OperatorApiPlan_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// APC Gateway Plan Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string operatorApiPlanName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operatorApiPlanName, nameof(operatorApiPlanName)); + + using var scope = _operatorApiPlanClientDiagnostics.CreateScope("OperatorApiPlanCollection.Exists"); + scope.Start(); + try + { + var response = _operatorApiPlanRestClient.Get(Id.SubscriptionId, operatorApiPlanName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/{operatorApiPlanName} + /// + /// + /// Operation Id + /// OperatorApiPlan_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// APC Gateway Plan Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string operatorApiPlanName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operatorApiPlanName, nameof(operatorApiPlanName)); + + using var scope = _operatorApiPlanClientDiagnostics.CreateScope("OperatorApiPlanCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _operatorApiPlanRestClient.GetAsync(Id.SubscriptionId, operatorApiPlanName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new OperatorApiPlanResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/{operatorApiPlanName} + /// + /// + /// Operation Id + /// OperatorApiPlan_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// APC Gateway Plan Name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string operatorApiPlanName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operatorApiPlanName, nameof(operatorApiPlanName)); + + using var scope = _operatorApiPlanClientDiagnostics.CreateScope("OperatorApiPlanCollection.GetIfExists"); + scope.Start(); + try + { + var response = _operatorApiPlanRestClient.Get(Id.SubscriptionId, operatorApiPlanName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new OperatorApiPlanResource(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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiPlanData.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiPlanData.Serialization.cs new file mode 100644 index 000000000000..ffeee5b8ca70 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiPlanData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.ProgrammableConnectivity.Models; + +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + public partial class OperatorApiPlanData : 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(OperatorApiPlanData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + OperatorApiPlanData 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(OperatorApiPlanData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperatorApiPlanData(document.RootElement, options); + } + + internal static OperatorApiPlanData DeserializeOperatorApiPlanData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OperatorApiPlanProperties properties = 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 = OperatorApiPlanProperties.DeserializeOperatorApiPlanProperties(property.Value, options); + 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 OperatorApiPlanData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerProgrammableConnectivityContext.Default); + default: + throw new FormatException($"The model {nameof(OperatorApiPlanData)} does not support writing '{options.Format}' format."); + } + } + + OperatorApiPlanData 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 DeserializeOperatorApiPlanData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperatorApiPlanData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiPlanData.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiPlanData.cs new file mode 100644 index 000000000000..0739b36d4611 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiPlanData.cs @@ -0,0 +1,75 @@ +// 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.ProgrammableConnectivity.Models; + +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + /// + /// A class representing the OperatorApiPlan data model. + /// A Programmable Connectivity Operator API Plans resource. This is a readonly resource that indicates which Operator Network APIs are available in the user's subscription. + /// + public partial class OperatorApiPlanData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal OperatorApiPlanData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal OperatorApiPlanData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, OperatorApiPlanProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public OperatorApiPlanProperties Properties { get; } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiPlanResource.Serialization.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiPlanResource.Serialization.cs new file mode 100644 index 000000000000..8dd7278b5bac --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiPlanResource.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.ProgrammableConnectivity +{ + public partial class OperatorApiPlanResource : IJsonModel + { + private static OperatorApiPlanData s_dataDeserializationInstance; + private static OperatorApiPlanData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + OperatorApiPlanData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerProgrammableConnectivityContext.Default); + + OperatorApiPlanData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerProgrammableConnectivityContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiPlanResource.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiPlanResource.cs new file mode 100644 index 000000000000..4c9fd1a1b47f --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/OperatorApiPlanResource.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + /// + /// A Class representing an OperatorApiPlan along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetOperatorApiPlanResource method. + /// Otherwise you can get one from its parent resource using the GetOperatorApiPlan method. + /// + public partial class OperatorApiPlanResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The operatorApiPlanName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string operatorApiPlanName) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/{operatorApiPlanName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _operatorApiPlanClientDiagnostics; + private readonly OperatorApiPlansRestOperations _operatorApiPlanRestClient; + private readonly OperatorApiPlanData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ProgrammableConnectivity/operatorApiPlans"; + + /// Initializes a new instance of the class for mocking. + protected OperatorApiPlanResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal OperatorApiPlanResource(ArmClient client, OperatorApiPlanData 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 OperatorApiPlanResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _operatorApiPlanClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ProgrammableConnectivity", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string operatorApiPlanApiVersion); + _operatorApiPlanRestClient = new OperatorApiPlansRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, operatorApiPlanApiVersion); +#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 OperatorApiPlanData 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 an OperatorApiPlan resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/{operatorApiPlanName} + /// + /// + /// Operation Id + /// OperatorApiPlan_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _operatorApiPlanClientDiagnostics.CreateScope("OperatorApiPlanResource.Get"); + scope.Start(); + try + { + var response = await _operatorApiPlanRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new OperatorApiPlanResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get an OperatorApiPlan resource by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/{operatorApiPlanName} + /// + /// + /// Operation Id + /// OperatorApiPlan_Get + /// + /// + /// Default Api Version + /// 2025-03-30-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _operatorApiPlanClientDiagnostics.CreateScope("OperatorApiPlanResource.Get"); + scope.Start(); + try + { + var response = _operatorApiPlanRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new OperatorApiPlanResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/ProviderConstants.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..d3a3cbb2ed89 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/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.ProgrammableConnectivity +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/RestOperations/GatewaysRestOperations.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/RestOperations/GatewaysRestOperations.cs new file mode 100644 index 000000000000..e948450462e1 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/RestOperations/GatewaysRestOperations.cs @@ -0,0 +1,731 @@ +// 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.ProgrammableConnectivity.Models; + +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + internal partial class GatewaysRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of GatewaysRestOperations. + /// 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 GatewaysRestOperations(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-03-30-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string gatewayName) + { + 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.ProgrammableConnectivity/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string gatewayName) + { + 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.ProgrammableConnectivity/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Gateway resource by name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity Gateway Name. + /// 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 gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, gatewayName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GatewayData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GatewayData.DeserializeGatewayData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GatewayData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Gateway resource by name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity Gateway Name. + /// 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 gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, gatewayName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GatewayData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GatewayData.DeserializeGatewayData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GatewayData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string gatewayName, GatewayData 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.ProgrammableConnectivity/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string gatewayName, GatewayData 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.ProgrammableConnectivity/gateways/", false); + uri.AppendPath(gatewayName, 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 or update an APC Gateway. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity Gateway Name. + /// 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 CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string gatewayName, GatewayData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, gatewayName, 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 or update an APC Gateway. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity Gateway Name. + /// 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 CreateOrUpdate(string subscriptionId, string resourceGroupName, string gatewayName, GatewayData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, gatewayName, 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 gatewayName, GatewayPatch 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.ProgrammableConnectivity/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string gatewayName, GatewayPatch 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.ProgrammableConnectivity/gateways/", false); + uri.AppendPath(gatewayName, 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 Gateway tags. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity Gateway Name. + /// 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 gatewayName, GatewayPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, gatewayName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GatewayData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GatewayData.DeserializeGatewayData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update Gateway tags. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity Gateway Name. + /// 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 gatewayName, GatewayPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, gatewayName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GatewayData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GatewayData.DeserializeGatewayData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string gatewayName) + { + 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.ProgrammableConnectivity/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string gatewayName) + { + 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.ProgrammableConnectivity/gateways/", false); + uri.AppendPath(gatewayName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Gateway. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity Gateway Name. + /// 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 gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, gatewayName); + 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 Gateway. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity Gateway Name. + /// 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 gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, gatewayName); + _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.ProgrammableConnectivity/gateways", 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.ProgrammableConnectivity/gateways", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Gateway 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: + { + GatewayListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GatewayListResult.DeserializeGatewayListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Gateway 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: + { + GatewayListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GatewayListResult.DeserializeGatewayListResult(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.ProgrammableConnectivity/gateways", 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.ProgrammableConnectivity/gateways", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Gateway 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: + { + GatewayListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GatewayListResult.DeserializeGatewayListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Gateway 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: + { + GatewayListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GatewayListResult.DeserializeGatewayListResult(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 Gateway 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: + { + GatewayListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GatewayListResult.DeserializeGatewayListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Gateway 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: + { + GatewayListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GatewayListResult.DeserializeGatewayListResult(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 Gateway 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: + { + GatewayListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GatewayListResult.DeserializeGatewayListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Gateway 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: + { + GatewayListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GatewayListResult.DeserializeGatewayListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/RestOperations/OperatorApiConnectionsRestOperations.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/RestOperations/OperatorApiConnectionsRestOperations.cs new file mode 100644 index 000000000000..b339c9922e77 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/RestOperations/OperatorApiConnectionsRestOperations.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.ProgrammableConnectivity.Models; + +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + internal partial class OperatorApiConnectionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of OperatorApiConnectionsRestOperations. + /// 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 OperatorApiConnectionsRestOperations(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-03-30-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string operatorApiConnectionName) + { + 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.ProgrammableConnectivity/operatorApiConnections/", false); + uri.AppendPath(operatorApiConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string operatorApiConnectionName) + { + 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.ProgrammableConnectivity/operatorApiConnections/", false); + uri.AppendPath(operatorApiConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get an Operator API Connection. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// 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 operatorApiConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, operatorApiConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperatorApiConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OperatorApiConnectionData.DeserializeOperatorApiConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((OperatorApiConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get an Operator API Connection. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// 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 operatorApiConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, operatorApiConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperatorApiConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OperatorApiConnectionData.DeserializeOperatorApiConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((OperatorApiConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string operatorApiConnectionName, OperatorApiConnectionData 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.ProgrammableConnectivity/operatorApiConnections/", false); + uri.AppendPath(operatorApiConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string operatorApiConnectionName, OperatorApiConnectionData 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.ProgrammableConnectivity/operatorApiConnections/", false); + uri.AppendPath(operatorApiConnectionName, 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 an Operator API Connection. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// 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 operatorApiConnectionName, OperatorApiConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, operatorApiConnectionName, 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 an Operator API Connection. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// 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 operatorApiConnectionName, OperatorApiConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, operatorApiConnectionName, 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 operatorApiConnectionName, OperatorApiConnectionPatch 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.ProgrammableConnectivity/operatorApiConnections/", false); + uri.AppendPath(operatorApiConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string operatorApiConnectionName, OperatorApiConnectionPatch 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.ProgrammableConnectivity/operatorApiConnections/", false); + uri.AppendPath(operatorApiConnectionName, 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 an Operator API Connection. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// 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 operatorApiConnectionName, OperatorApiConnectionPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, operatorApiConnectionName, 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 an Operator API Connection. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// 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 operatorApiConnectionName, OperatorApiConnectionPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, operatorApiConnectionName, 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 operatorApiConnectionName) + { + 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.ProgrammableConnectivity/operatorApiConnections/", false); + uri.AppendPath(operatorApiConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string operatorApiConnectionName) + { + 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.ProgrammableConnectivity/operatorApiConnections/", false); + uri.AppendPath(operatorApiConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete an Operator API Connection. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// 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 operatorApiConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, operatorApiConnectionName); + 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 an Operator API Connection. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Azure Programmable Connectivity (APC) Operator API Connection Name. + /// 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 operatorApiConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(operatorApiConnectionName, nameof(operatorApiConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, operatorApiConnectionName); + _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.ProgrammableConnectivity/operatorApiConnections", 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.ProgrammableConnectivity/operatorApiConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List OperatorApiConnection 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: + { + OperatorApiConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OperatorApiConnectionListResult.DeserializeOperatorApiConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List OperatorApiConnection 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: + { + OperatorApiConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OperatorApiConnectionListResult.DeserializeOperatorApiConnectionListResult(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.ProgrammableConnectivity/operatorApiConnections", 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.ProgrammableConnectivity/operatorApiConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List OperatorApiConnection 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: + { + OperatorApiConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OperatorApiConnectionListResult.DeserializeOperatorApiConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List OperatorApiConnection 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: + { + OperatorApiConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OperatorApiConnectionListResult.DeserializeOperatorApiConnectionListResult(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 OperatorApiConnection 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: + { + OperatorApiConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OperatorApiConnectionListResult.DeserializeOperatorApiConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List OperatorApiConnection 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: + { + OperatorApiConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OperatorApiConnectionListResult.DeserializeOperatorApiConnectionListResult(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 OperatorApiConnection 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: + { + OperatorApiConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OperatorApiConnectionListResult.DeserializeOperatorApiConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List OperatorApiConnection 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: + { + OperatorApiConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OperatorApiConnectionListResult.DeserializeOperatorApiConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/RestOperations/OperatorApiPlansRestOperations.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/RestOperations/OperatorApiPlansRestOperations.cs new file mode 100644 index 000000000000..c142b7a55c92 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Generated/RestOperations/OperatorApiPlansRestOperations.cs @@ -0,0 +1,317 @@ +// 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.ProgrammableConnectivity.Models; + +namespace Azure.ResourceManager.ProgrammableConnectivity +{ + internal partial class OperatorApiPlansRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of OperatorApiPlansRestOperations. + /// 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 OperatorApiPlansRestOperations(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-03-30-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string operatorApiPlanName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans/", false); + uri.AppendPath(operatorApiPlanName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string operatorApiPlanName) + { + 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.ProgrammableConnectivity/operatorApiPlans/", false); + uri.AppendPath(operatorApiPlanName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get an OperatorApiPlan resource by name. + /// The ID of the target subscription. The value must be an UUID. + /// APC Gateway Plan Name. + /// 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 operatorApiPlanName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(operatorApiPlanName, nameof(operatorApiPlanName)); + + using var message = CreateGetRequest(subscriptionId, operatorApiPlanName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperatorApiPlanData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OperatorApiPlanData.DeserializeOperatorApiPlanData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((OperatorApiPlanData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get an OperatorApiPlan resource by name. + /// The ID of the target subscription. The value must be an UUID. + /// APC Gateway Plan Name. + /// 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 operatorApiPlanName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(operatorApiPlanName, nameof(operatorApiPlanName)); + + using var message = CreateGetRequest(subscriptionId, operatorApiPlanName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperatorApiPlanData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OperatorApiPlanData.DeserializeOperatorApiPlanData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((OperatorApiPlanData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId, string filter, int? top, int? skip) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ProgrammableConnectivity/operatorApiPlans", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string filter, int? top, int? skip) + { + 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.ProgrammableConnectivity/operatorApiPlans", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List OperatorApiPlan resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// An optional OData based filter expression to apply on the operation. + /// An optional query parameter which specifies the maximum number of records to be returned. + /// An optional query parameter which specifies the number of records to be skipped. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, string filter = null, int? top = null, int? skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, filter, top, skip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperatorApiPlanListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OperatorApiPlanListResult.DeserializeOperatorApiPlanListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List OperatorApiPlan resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// An optional OData based filter expression to apply on the operation. + /// An optional query parameter which specifies the maximum number of records to be returned. + /// An optional query parameter which specifies the number of records to be skipped. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, string filter = null, int? top = null, int? skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, filter, top, skip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperatorApiPlanListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OperatorApiPlanListResult.DeserializeOperatorApiPlanListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId, string filter, int? top, int? skip) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string filter, int? top, int? skip) + { + 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 OperatorApiPlan resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// An optional OData based filter expression to apply on the operation. + /// An optional query parameter which specifies the maximum number of records to be returned. + /// An optional query parameter which specifies the number of records to be skipped. + /// 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, string filter = null, int? top = null, int? skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, filter, top, skip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperatorApiPlanListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OperatorApiPlanListResult.DeserializeOperatorApiPlanListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List OperatorApiPlan resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// An optional OData based filter expression to apply on the operation. + /// An optional query parameter which specifies the maximum number of records to be returned. + /// An optional query parameter which specifies the number of records to be skipped. + /// 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, string filter = null, int? top = null, int? skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, filter, top, skip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperatorApiPlanListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OperatorApiPlanListResult.DeserializeOperatorApiPlanListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Properties/AssemblyInfo.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..29eb4dd335ab --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/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.ProgrammableConnectivity.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("ProgrammableConnectivity")] diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/tests/Azure.ResourceManager.ProgrammableConnectivity.Tests.csproj b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/tests/Azure.ResourceManager.ProgrammableConnectivity.Tests.csproj new file mode 100644 index 000000000000..4f06415c0a90 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/tests/Azure.ResourceManager.ProgrammableConnectivity.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/tests/ProgrammableConnectivityManagementTestBase.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/tests/ProgrammableConnectivityManagementTestBase.cs new file mode 100644 index 000000000000..7b51e596414f --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/tests/ProgrammableConnectivityManagementTestBase.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.ProgrammableConnectivity.Tests +{ + public class ProgrammableConnectivityManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected ProgrammableConnectivityManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected ProgrammableConnectivityManagementTestBase(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/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/tests/ProgrammableConnectivityManagementTestEnvironment.cs b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/tests/ProgrammableConnectivityManagementTestEnvironment.cs new file mode 100644 index 000000000000..685f29b00f45 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/tests/ProgrammableConnectivityManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.ProgrammableConnectivity.Tests +{ + public class ProgrammableConnectivityManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/tsp-location.yaml b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/tsp-location.yaml new file mode 100644 index 000000000000..06fef6783dd9 --- /dev/null +++ b/sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/programmableconnectivity/ProgrammableConnectivity.Management +commit: e6d3b34586c6b12c2a2e0d9aa648ff32c9c3b38b +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/programmableconnectivity/ci.mgmt.yml b/sdk/programmableconnectivity/ci.mgmt.yml new file mode 100644 index 000000000000..e49fa987c75c --- /dev/null +++ b/sdk/programmableconnectivity/ci.mgmt.yml @@ -0,0 +1,26 @@ +# 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/programmableconnectivity /ci.mgmt.yml + - sdk/programmableconnectivity /Azure.ResourceManager.ProgrammableConnectivity / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: programmableconnectivity + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.ProgrammableConnectivity + safeName: AzureResourceManagerProgrammableConnectivity diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 48f5ec6af73e..f0800b568714 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -162,6 +162,7 @@ trigger: - sdk/postgresql/Azure.ResourceManager.PostgreSql - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated - sdk/privatedns/Azure.ResourceManager.PrivateDns + - sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity - sdk/providerhub/Azure.ResourceManager.ProviderHub - sdk/purview/Azure.ResourceManager.Purview - sdk/quantum/Azure.ResourceManager.Quantum @@ -380,6 +381,7 @@ pr: - sdk/postgresql/Azure.ResourceManager.PostgreSql - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated - sdk/privatedns/Azure.ResourceManager.PrivateDns + - sdk/programmableconnectivity/Azure.ResourceManager.ProgrammableConnectivity - sdk/providerhub/Azure.ResourceManager.ProviderHub - sdk/purview/Azure.ResourceManager.Purview - sdk/quantum/Azure.ResourceManager.Quantum diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/