diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/Azure.ResourceManager.IoTOperations.sln b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/Azure.ResourceManager.IoTOperations.sln
new file mode 100644
index 000000000000..3528878c41ce
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/Azure.ResourceManager.IoTOperations.sln
@@ -0,0 +1,56 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29709.97
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.IoTOperations", "src\Azure.ResourceManager.IoTOperations.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.IoTOperations.Tests", "tests\Azure.ResourceManager.IoTOperations.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
+ EndGlobalSection
+EndGlobal
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/CHANGELOG.md b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/CHANGELOG.md
new file mode 100644
index 000000000000..13dd08af78ab
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/CHANGELOG.md
@@ -0,0 +1,11 @@
+# Release History
+
+## 1.0.0-beta.1 (Unreleased)
+
+### Features Added
+
+### Breaking Changes
+
+### Bugs Fixed
+
+### Other Changes
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/Directory.Build.props b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/Directory.Build.props
new file mode 100644
index 000000000000..63bd836ad44b
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/Directory.Build.props
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/README.md b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/README.md
new file mode 100644
index 000000000000..92abdc4c0f4c
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/README.md
@@ -0,0 +1,86 @@
+# Azure.ResourceManager.IoTOperations client library for .NET
+
+Azure.ResourceManager.IoTOperations is a managed service that helps developers get secret simply and securely.
+
+Use the client library for to:
+
+* [Get secret](https://docs.microsoft.com/azure)
+
+[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples]
+
+ [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure)
+
+## Getting started
+
+This section should include everything a developer needs to do to install and create their first client connection *very quickly*.
+
+### Install the package
+
+First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository.
+
+Install the client library for .NET with [NuGet](https://www.nuget.org/ ):
+
+```dotnetcli
+dotnet add package Azure.ResourceManager.IoTOperations --prerelease
+```
+
+### Prerequisites
+
+Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB:
+
+> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`.
+
+### Authenticate the client
+
+If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating.
+
+For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object.
+
+## Key concepts
+
+The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity.
+
+Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of:
+
+### Thread safety
+
+We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads.
+
+### Additional concepts
+
+[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) |
+[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) |
+[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) |
+[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) |
+[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) |
+[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) |
+[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/)
+
+
+## Examples
+
+You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/iotoperations/Azure.ResourceManager.IoTOperations/samples).
+
+## Troubleshooting
+
+Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery.
+
+Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API.
+
+If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code.
+
+## Next steps
+
+* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory.
+* If appropriate, point users to other packages that might be useful.
+* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for.
+
+## Contributing
+
+This is a template, but your SDK readme should include details on how to contribute code to the repo/package.
+
+
+[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization
+[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide
+
+
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Azure.ResourceManager.IoTOperations.csproj b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Azure.ResourceManager.IoTOperations.csproj
new file mode 100644
index 000000000000..f35cdf07bb01
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Azure.ResourceManager.IoTOperations.csproj
@@ -0,0 +1,10 @@
+
+
+ This is the Azure.ResourceManager.IoTOperations client library for developing .NET applications with rich experience.
+ Azure SDK Code Generation Azure.ResourceManager.IoTOperations for Azure Data Plane
+ 1.0.0-beta.1
+ Azure.ResourceManager.IoTOperations
+ $(RequiredTargetFrameworks)
+ true
+
+
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/ArmIoTOperationsModelFactory.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/ArmIoTOperationsModelFactory.cs
new file mode 100644
index 000000000000..041283839209
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/ArmIoTOperationsModelFactory.cs
@@ -0,0 +1,335 @@
+// 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.IoTOperations.Models
+{
+ /// Model factory for models.
+ public static partial class ArmIoTOperationsModelFactory
+ {
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// Edge location of the resource.
+ /// A new instance for mocking.
+ public static DataflowEndpointResourceData DataflowEndpointResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataflowEndpointProperties properties = null, ExtendedLocation extendedLocation = null)
+ {
+ return new DataflowEndpointResourceData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ properties,
+ extendedLocation,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Endpoint Type.
+ /// Azure Data Explorer endpoint.
+ /// Azure Data Lake endpoint.
+ /// Microsoft Fabric endpoint.
+ /// Kafka endpoint.
+ /// Local persistent volume endpoint.
+ /// Broker endpoint.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static DataflowEndpointProperties DataflowEndpointProperties(EndpointType endpointType = default, DataflowEndpointDataExplorer dataExplorerSettings = null, DataflowEndpointDataLakeStorage dataLakeStorageSettings = null, DataflowEndpointFabricOneLake fabricOneLakeSettings = null, DataflowEndpointKafka kafkaSettings = null, string localStoragePersistentVolumeClaimRef = null, DataflowEndpointMqtt mqttSettings = null, ProvisioningState? provisioningState = null)
+ {
+ return new DataflowEndpointProperties(
+ endpointType,
+ dataExplorerSettings,
+ dataLakeStorageSettings,
+ fabricOneLakeSettings,
+ kafkaSettings,
+ localStoragePersistentVolumeClaimRef != null ? new DataflowEndpointLocalStorage(localStoragePersistentVolumeClaimRef, serializedAdditionalRawData: null) : null,
+ mqttSettings,
+ provisioningState,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// Edge location of the resource.
+ /// A new instance for mocking.
+ public static DataflowResourceData DataflowResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataflowProperties properties = null, ExtendedLocation extendedLocation = null)
+ {
+ return new DataflowResourceData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ properties,
+ extendedLocation,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Mode for Dataflow. Optional; defaults to Enabled.
+ /// List of operations including source and destination references as well as transformation.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static DataflowProperties DataflowProperties(OperationalMode? mode = null, IEnumerable operations = null, ProvisioningState? provisioningState = null)
+ {
+ operations ??= new List();
+
+ return new DataflowProperties(mode, operations?.ToList(), provisioningState, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// Edge location of the resource.
+ /// A new instance for mocking.
+ public static DataflowProfileResourceData DataflowProfileResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataflowProfileProperties properties = null, ExtendedLocation extendedLocation = null)
+ {
+ return new DataflowProfileResourceData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ properties,
+ extendedLocation,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Spec defines the desired identities of NBC diagnostics settings.
+ /// To manually scale the dataflow profile, specify the maximum number of instances you want to run.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static DataflowProfileProperties DataflowProfileProperties(ProfileDiagnostics diagnostics = null, int? instanceCount = null, ProvisioningState? provisioningState = null)
+ {
+ return new DataflowProfileProperties(diagnostics, instanceCount, provisioningState, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// Edge location of the resource.
+ /// A new instance for mocking.
+ public static BrokerAuthorizationResourceData BrokerAuthorizationResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, BrokerAuthorizationProperties properties = null, ExtendedLocation extendedLocation = null)
+ {
+ return new BrokerAuthorizationResourceData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ properties,
+ extendedLocation,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The list of authorization policies supported by the Authorization Resource.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static BrokerAuthorizationProperties BrokerAuthorizationProperties(AuthorizationConfig authorizationPolicies = null, ProvisioningState? provisioningState = null)
+ {
+ return new BrokerAuthorizationProperties(authorizationPolicies, provisioningState, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// Edge location of the resource.
+ /// A new instance for mocking.
+ public static BrokerAuthenticationResourceData BrokerAuthenticationResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, BrokerAuthenticationProperties properties = null, ExtendedLocation extendedLocation = null)
+ {
+ return new BrokerAuthenticationResourceData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ properties,
+ extendedLocation,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Defines a set of Broker authentication methods to be used on `BrokerListeners`. For each array element one authenticator type supported.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static BrokerAuthenticationProperties BrokerAuthenticationProperties(IEnumerable authenticationMethods = null, ProvisioningState? provisioningState = null)
+ {
+ authenticationMethods ??= new List();
+
+ return new BrokerAuthenticationProperties(authenticationMethods?.ToList(), provisioningState, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// Edge location of the resource.
+ /// A new instance for mocking.
+ public static BrokerListenerResourceData BrokerListenerResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, BrokerListenerProperties properties = null, ExtendedLocation extendedLocation = null)
+ {
+ return new BrokerListenerResourceData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ properties,
+ extendedLocation,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Kubernetes Service name of this listener.
+ /// Ports on which this listener accepts client connections.
+ /// Kubernetes Service type of this listener.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static BrokerListenerProperties BrokerListenerProperties(string serviceName = null, IEnumerable ports = null, ServiceType? serviceType = null, ProvisioningState? provisioningState = null)
+ {
+ ports ??= new List();
+
+ return new BrokerListenerProperties(serviceName, ports?.ToList(), serviceType, provisioningState, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// Edge location of the resource.
+ /// A new instance for mocking.
+ public static BrokerResourceData BrokerResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, BrokerProperties properties = null, ExtendedLocation extendedLocation = null)
+ {
+ return new BrokerResourceData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ properties,
+ extendedLocation,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Advanced settings of Broker.
+ /// The cardinality details of the broker.
+ /// Spec defines the desired identities of Broker diagnostics settings.
+ /// Settings of Disk Backed Message Buffer.
+ /// This setting controls whether Kubernetes CPU resource limits are requested. Increasing the number of replicas or workers proportionally increases the amount of CPU resources requested. If this setting is enabled and there are insufficient CPU resources, an error will be emitted.
+ /// Memory profile of Broker.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static BrokerProperties BrokerProperties(AdvancedSettings advanced = null, Cardinality cardinality = null, BrokerDiagnostics diagnostics = null, DiskBackedMessageBuffer diskBackedMessageBuffer = null, OperationalMode? generateResourceLimitsCpu = null, BrokerMemoryProfile? memoryProfile = null, ProvisioningState? provisioningState = null)
+ {
+ return new BrokerProperties(
+ advanced,
+ cardinality,
+ diagnostics,
+ diskBackedMessageBuffer,
+ generateResourceLimitsCpu != null ? new GenerateResourceLimits(generateResourceLimitsCpu, serializedAdditionalRawData: null) : null,
+ memoryProfile,
+ provisioningState,
+ 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.
+ /// Edge location of the resource.
+ /// The managed service identities assigned to this resource.
+ /// A new instance for mocking.
+ public static InstanceResourceData InstanceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, InstanceProperties properties = null, ExtendedLocation extendedLocation = null, ManagedServiceIdentity identity = null)
+ {
+ tags ??= new Dictionary();
+
+ return new InstanceResourceData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ tags,
+ location,
+ properties,
+ extendedLocation,
+ identity,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Detailed description of the Instance.
+ /// The status of the last operation.
+ /// The Azure IoT Operations version.
+ /// The reference to the Schema Registry for this AIO Instance.
+ /// The configuration for components of the AIO Instance.
+ /// A new instance for mocking.
+ public static InstanceProperties InstanceProperties(string description = null, ProvisioningState? provisioningState = null, string version = null, string schemaRegistryNamespace = null, Components components = null)
+ {
+ return new InstanceProperties(
+ description,
+ provisioningState,
+ version,
+ schemaRegistryNamespace,
+ components,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
+ /// Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations.
+ /// Localized display information for this particular operation.
+ /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system".
+ /// Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ /// A new instance for mocking.
+ public static Operation Operation(string name = null, bool? isDataAction = null, OperationDisplay display = null, Origin? origin = null, ActionType? actionType = null)
+ {
+ return new Operation(
+ name,
+ isDataAction,
+ display,
+ origin,
+ actionType,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute".
+ /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections".
+ /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine".
+ /// The short, localized friendly description of the operation; suitable for tool tips and detailed views.
+ /// A new instance for mocking.
+ public static OperationDisplay OperationDisplay(string provider = null, string resource = null, string operation = null, string description = null)
+ {
+ return new OperationDisplay(provider, resource, operation, description, serializedAdditionalRawData: null);
+ }
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResource.Serialization.cs
new file mode 100644
index 000000000000..d5475abe9159
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResource.Serialization.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ public partial class BrokerAuthenticationResource : IJsonModel
+ {
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options);
+
+ BrokerAuthenticationResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options);
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options);
+
+ BrokerAuthenticationResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options);
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options);
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResource.cs
new file mode 100644
index 000000000000..48182ae5fa1a
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResource.cs
@@ -0,0 +1,348 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ ///
+ /// A Class representing a BrokerAuthenticationResource 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 GetBrokerAuthenticationResource method.
+ /// Otherwise you can get one from its parent resource using the GetBrokerAuthenticationResource method.
+ ///
+ public partial class BrokerAuthenticationResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ /// The subscriptionId.
+ /// The resourceGroupName.
+ /// The instanceName.
+ /// The brokerName.
+ /// The authenticationName.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authenticationName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics;
+ private readonly BrokerAuthenticationRestOperations _brokerAuthenticationResourceBrokerAuthenticationRestClient;
+ private readonly BrokerAuthenticationResourceData _data;
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/brokers/authentications";
+
+ /// Initializes a new instance of the class for mocking.
+ protected BrokerAuthenticationResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal BrokerAuthenticationResource(ArmClient client, BrokerAuthenticationResourceData 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 BrokerAuthenticationResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string brokerAuthenticationResourceBrokerAuthenticationApiVersion);
+ _brokerAuthenticationResourceBrokerAuthenticationRestClient = new BrokerAuthenticationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerAuthenticationResourceBrokerAuthenticationApiVersion);
+#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 BrokerAuthenticationResourceData 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 BrokerAuthenticationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _brokerAuthenticationResourceBrokerAuthenticationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerAuthenticationResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a BrokerAuthenticationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _brokerAuthenticationResourceBrokerAuthenticationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerAuthenticationResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a BrokerAuthenticationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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 = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _brokerAuthenticationResourceBrokerAuthenticationRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ var operation = new IoTOperationsArmOperation(_brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, 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 BrokerAuthenticationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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 = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = _brokerAuthenticationResourceBrokerAuthenticationRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
+ var operation = new IoTOperationsArmOperation(_brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a BrokerAuthenticationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(WaitUntil waitUntil, BrokerAuthenticationResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResource.Update");
+ scope.Start();
+ try
+ {
+ var response = await _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);
+ var operation = new IoTOperationsArmOperation(new BrokerAuthenticationResourceOperationSource(Client), _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a BrokerAuthenticationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation Update(WaitUntil waitUntil, BrokerAuthenticationResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResource.Update");
+ scope.Start();
+ try
+ {
+ var response = _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken);
+ var operation = new IoTOperationsArmOperation(new BrokerAuthenticationResourceOperationSource(Client), _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceCollection.cs
new file mode 100644
index 000000000000..fa5acbc86490
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceCollection.cs
@@ -0,0 +1,493 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Autorest.CSharp.Core;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ ///
+ /// 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 GetBrokerAuthenticationResources method from an instance of .
+ ///
+ public partial class BrokerAuthenticationResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics;
+ private readonly BrokerAuthenticationRestOperations _brokerAuthenticationResourceBrokerAuthenticationRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected BrokerAuthenticationResourceCollection()
+ {
+ }
+
+ /// 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 BrokerAuthenticationResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", BrokerAuthenticationResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(BrokerAuthenticationResource.ResourceType, out string brokerAuthenticationResourceBrokerAuthenticationApiVersion);
+ _brokerAuthenticationResourceBrokerAuthenticationRestClient = new BrokerAuthenticationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerAuthenticationResourceBrokerAuthenticationApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != BrokerResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BrokerResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Create a BrokerAuthenticationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Name of Instance broker authentication resource.
+ /// 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 authenticationName, BrokerAuthenticationResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, data, cancellationToken).ConfigureAwait(false);
+ var operation = new IoTOperationsArmOperation(new BrokerAuthenticationResourceOperationSource(Client), _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a BrokerAuthenticationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Name of Instance broker authentication resource.
+ /// 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 authenticationName, BrokerAuthenticationResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, data, cancellationToken);
+ var operation = new IoTOperationsArmOperation(new BrokerAuthenticationResourceOperationSource(Client), _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a BrokerAuthenticationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authentication resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string authenticationName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName));
+
+ using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _brokerAuthenticationResourceBrokerAuthenticationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerAuthenticationResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a BrokerAuthenticationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authentication resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string authenticationName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName));
+
+ using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _brokerAuthenticationResourceBrokerAuthenticationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerAuthenticationResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List BrokerAuthenticationResource resources by BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthenticationResource_ListByResourceGroup
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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) => _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BrokerAuthenticationResource(Client, BrokerAuthenticationResourceData.DeserializeBrokerAuthenticationResourceData(e)), _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, "BrokerAuthenticationResourceCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List BrokerAuthenticationResource resources by BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthenticationResource_ListByResourceGroup
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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) => _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerAuthenticationResourceBrokerAuthenticationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BrokerAuthenticationResource(Client, BrokerAuthenticationResourceData.DeserializeBrokerAuthenticationResourceData(e)), _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics, Pipeline, "BrokerAuthenticationResourceCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authentication resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string authenticationName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName));
+
+ using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _brokerAuthenticationResourceBrokerAuthenticationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, 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.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authentication resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string authenticationName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName));
+
+ using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _brokerAuthenticationResourceBrokerAuthenticationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, 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.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authentication resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetIfExistsAsync(string authenticationName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName));
+
+ using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = await _brokerAuthenticationResourceBrokerAuthenticationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new BrokerAuthenticationResource(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.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authentication resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual NullableResponse GetIfExists(string authenticationName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationName, nameof(authenticationName));
+
+ using var scope = _brokerAuthenticationResourceBrokerAuthenticationClientDiagnostics.CreateScope("BrokerAuthenticationResourceCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = _brokerAuthenticationResourceBrokerAuthenticationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authenticationName, cancellationToken: cancellationToken);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new BrokerAuthenticationResource(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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceData.Serialization.cs
new file mode 100644
index 000000000000..85b0a4386685
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceData.Serialization.cs
@@ -0,0 +1,191 @@
+// 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.IoTOperations.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ public partial class BrokerAuthenticationResourceData : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(BrokerAuthenticationResourceData)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ if (Optional.IsDefined(Properties))
+ {
+ writer.WritePropertyName("properties"u8);
+ writer.WriteObjectValue(Properties, options);
+ }
+ writer.WritePropertyName("extendedLocation"u8);
+ writer.WriteObjectValue(ExtendedLocation, options);
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("id"u8);
+ writer.WriteStringValue(Id);
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(ResourceType);
+ }
+ if (options.Format != "W" && Optional.IsDefined(SystemData))
+ {
+ writer.WritePropertyName("systemData"u8);
+ JsonSerializer.Serialize(writer, SystemData);
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ BrokerAuthenticationResourceData 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(BrokerAuthenticationResourceData)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeBrokerAuthenticationResourceData(document.RootElement, options);
+ }
+
+ internal static BrokerAuthenticationResourceData DeserializeBrokerAuthenticationResourceData(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ BrokerAuthenticationProperties properties = default;
+ ExtendedLocation extendedLocation = 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 = BrokerAuthenticationProperties.DeserializeBrokerAuthenticationProperties(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("extendedLocation"u8))
+ {
+ extendedLocation = ExtendedLocation.DeserializeExtendedLocation(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 BrokerAuthenticationResourceData(
+ id,
+ name,
+ type,
+ systemData,
+ properties,
+ extendedLocation,
+ serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(BrokerAuthenticationResourceData)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ BrokerAuthenticationResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeBrokerAuthenticationResourceData(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(BrokerAuthenticationResourceData)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceData.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceData.cs
new file mode 100644
index 000000000000..7b6ef1b609e1
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthenticationResourceData.cs
@@ -0,0 +1,89 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using Azure.Core;
+using Azure.ResourceManager.IoTOperations.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ ///
+ /// A class representing the BrokerAuthenticationResource data model.
+ /// Instance broker authentication resource
+ ///
+ public partial class BrokerAuthenticationResourceData : 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 .
+ /// Edge location of the resource.
+ /// is null.
+ public BrokerAuthenticationResourceData(ExtendedLocation extendedLocation)
+ {
+ Argument.AssertNotNull(extendedLocation, nameof(extendedLocation));
+
+ ExtendedLocation = extendedLocation;
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// Edge location of the resource.
+ /// Keeps track of any properties unknown to the library.
+ internal BrokerAuthenticationResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, BrokerAuthenticationProperties properties, ExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData)
+ {
+ Properties = properties;
+ ExtendedLocation = extendedLocation;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal BrokerAuthenticationResourceData()
+ {
+ }
+
+ /// The resource-specific properties for this resource.
+ public BrokerAuthenticationProperties Properties { get; set; }
+ /// Edge location of the resource.
+ public ExtendedLocation ExtendedLocation { get; set; }
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResource.Serialization.cs
new file mode 100644
index 000000000000..ee32487ae044
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResource.Serialization.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ public partial class BrokerAuthorizationResource : IJsonModel
+ {
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options);
+
+ BrokerAuthorizationResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options);
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options);
+
+ BrokerAuthorizationResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options);
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options);
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResource.cs
new file mode 100644
index 000000000000..889063d2b6ae
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResource.cs
@@ -0,0 +1,348 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ ///
+ /// A Class representing a BrokerAuthorizationResource 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 GetBrokerAuthorizationResource method.
+ /// Otherwise you can get one from its parent resource using the GetBrokerAuthorizationResource method.
+ ///
+ public partial class BrokerAuthorizationResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ /// The subscriptionId.
+ /// The resourceGroupName.
+ /// The instanceName.
+ /// The brokerName.
+ /// The authorizationName.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string authorizationName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics;
+ private readonly BrokerAuthorizationRestOperations _brokerAuthorizationResourceBrokerAuthorizationRestClient;
+ private readonly BrokerAuthorizationResourceData _data;
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/brokers/authorizations";
+
+ /// Initializes a new instance of the class for mocking.
+ protected BrokerAuthorizationResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal BrokerAuthorizationResource(ArmClient client, BrokerAuthorizationResourceData 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 BrokerAuthorizationResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string brokerAuthorizationResourceBrokerAuthorizationApiVersion);
+ _brokerAuthorizationResourceBrokerAuthorizationRestClient = new BrokerAuthorizationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerAuthorizationResourceBrokerAuthorizationApiVersion);
+#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 BrokerAuthorizationResourceData 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 BrokerAuthorizationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _brokerAuthorizationResourceBrokerAuthorizationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerAuthorizationResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a BrokerAuthorizationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _brokerAuthorizationResourceBrokerAuthorizationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerAuthorizationResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a BrokerAuthorizationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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 = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _brokerAuthorizationResourceBrokerAuthorizationRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ var operation = new IoTOperationsArmOperation(_brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, 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 BrokerAuthorizationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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 = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = _brokerAuthorizationResourceBrokerAuthorizationRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
+ var operation = new IoTOperationsArmOperation(_brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a BrokerAuthorizationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(WaitUntil waitUntil, BrokerAuthorizationResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResource.Update");
+ scope.Start();
+ try
+ {
+ var response = await _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);
+ var operation = new IoTOperationsArmOperation(new BrokerAuthorizationResourceOperationSource(Client), _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a BrokerAuthorizationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation Update(WaitUntil waitUntil, BrokerAuthorizationResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResource.Update");
+ scope.Start();
+ try
+ {
+ var response = _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken);
+ var operation = new IoTOperationsArmOperation(new BrokerAuthorizationResourceOperationSource(Client), _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceCollection.cs
new file mode 100644
index 000000000000..fc6869c08cc0
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceCollection.cs
@@ -0,0 +1,493 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Autorest.CSharp.Core;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ ///
+ /// 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 GetBrokerAuthorizationResources method from an instance of .
+ ///
+ public partial class BrokerAuthorizationResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics;
+ private readonly BrokerAuthorizationRestOperations _brokerAuthorizationResourceBrokerAuthorizationRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected BrokerAuthorizationResourceCollection()
+ {
+ }
+
+ /// 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 BrokerAuthorizationResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", BrokerAuthorizationResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(BrokerAuthorizationResource.ResourceType, out string brokerAuthorizationResourceBrokerAuthorizationApiVersion);
+ _brokerAuthorizationResourceBrokerAuthorizationRestClient = new BrokerAuthorizationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerAuthorizationResourceBrokerAuthorizationApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != BrokerResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BrokerResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Create a BrokerAuthorizationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Name of Instance broker authorization resource.
+ /// 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 authorizationName, BrokerAuthorizationResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, data, cancellationToken).ConfigureAwait(false);
+ var operation = new IoTOperationsArmOperation(new BrokerAuthorizationResourceOperationSource(Client), _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a BrokerAuthorizationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Name of Instance broker authorization resource.
+ /// 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 authorizationName, BrokerAuthorizationResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, data, cancellationToken);
+ var operation = new IoTOperationsArmOperation(new BrokerAuthorizationResourceOperationSource(Client), _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a BrokerAuthorizationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authorization resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string authorizationName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName));
+
+ using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _brokerAuthorizationResourceBrokerAuthorizationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerAuthorizationResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a BrokerAuthorizationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authorization resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string authorizationName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName));
+
+ using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _brokerAuthorizationResourceBrokerAuthorizationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerAuthorizationResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List BrokerAuthorizationResource resources by BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorizationResource_ListByResourceGroup
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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) => _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BrokerAuthorizationResource(Client, BrokerAuthorizationResourceData.DeserializeBrokerAuthorizationResourceData(e)), _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, "BrokerAuthorizationResourceCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List BrokerAuthorizationResource resources by BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorizationResource_ListByResourceGroup
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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) => _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerAuthorizationResourceBrokerAuthorizationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BrokerAuthorizationResource(Client, BrokerAuthorizationResourceData.DeserializeBrokerAuthorizationResourceData(e)), _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics, Pipeline, "BrokerAuthorizationResourceCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authorization resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string authorizationName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName));
+
+ using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _brokerAuthorizationResourceBrokerAuthorizationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, 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.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authorization resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string authorizationName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName));
+
+ using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _brokerAuthorizationResourceBrokerAuthorizationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, 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.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authorization resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetIfExistsAsync(string authorizationName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName));
+
+ using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = await _brokerAuthorizationResourceBrokerAuthorizationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new BrokerAuthorizationResource(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.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authorization resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual NullableResponse GetIfExists(string authorizationName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authorizationName, nameof(authorizationName));
+
+ using var scope = _brokerAuthorizationResourceBrokerAuthorizationClientDiagnostics.CreateScope("BrokerAuthorizationResourceCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = _brokerAuthorizationResourceBrokerAuthorizationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, authorizationName, cancellationToken: cancellationToken);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new BrokerAuthorizationResource(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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceData.Serialization.cs
new file mode 100644
index 000000000000..9508fde75e51
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceData.Serialization.cs
@@ -0,0 +1,191 @@
+// 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.IoTOperations.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ public partial class BrokerAuthorizationResourceData : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(BrokerAuthorizationResourceData)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ if (Optional.IsDefined(Properties))
+ {
+ writer.WritePropertyName("properties"u8);
+ writer.WriteObjectValue(Properties, options);
+ }
+ writer.WritePropertyName("extendedLocation"u8);
+ writer.WriteObjectValue(ExtendedLocation, options);
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("id"u8);
+ writer.WriteStringValue(Id);
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(ResourceType);
+ }
+ if (options.Format != "W" && Optional.IsDefined(SystemData))
+ {
+ writer.WritePropertyName("systemData"u8);
+ JsonSerializer.Serialize(writer, SystemData);
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ BrokerAuthorizationResourceData 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(BrokerAuthorizationResourceData)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeBrokerAuthorizationResourceData(document.RootElement, options);
+ }
+
+ internal static BrokerAuthorizationResourceData DeserializeBrokerAuthorizationResourceData(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ BrokerAuthorizationProperties properties = default;
+ ExtendedLocation extendedLocation = 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 = BrokerAuthorizationProperties.DeserializeBrokerAuthorizationProperties(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("extendedLocation"u8))
+ {
+ extendedLocation = ExtendedLocation.DeserializeExtendedLocation(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 BrokerAuthorizationResourceData(
+ id,
+ name,
+ type,
+ systemData,
+ properties,
+ extendedLocation,
+ serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(BrokerAuthorizationResourceData)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ BrokerAuthorizationResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeBrokerAuthorizationResourceData(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(BrokerAuthorizationResourceData)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceData.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceData.cs
new file mode 100644
index 000000000000..006a048e3b06
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerAuthorizationResourceData.cs
@@ -0,0 +1,89 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using Azure.Core;
+using Azure.ResourceManager.IoTOperations.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ ///
+ /// A class representing the BrokerAuthorizationResource data model.
+ /// Instance broker authorizations resource
+ ///
+ public partial class BrokerAuthorizationResourceData : 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 .
+ /// Edge location of the resource.
+ /// is null.
+ public BrokerAuthorizationResourceData(ExtendedLocation extendedLocation)
+ {
+ Argument.AssertNotNull(extendedLocation, nameof(extendedLocation));
+
+ ExtendedLocation = extendedLocation;
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// Edge location of the resource.
+ /// Keeps track of any properties unknown to the library.
+ internal BrokerAuthorizationResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, BrokerAuthorizationProperties properties, ExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData)
+ {
+ Properties = properties;
+ ExtendedLocation = extendedLocation;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal BrokerAuthorizationResourceData()
+ {
+ }
+
+ /// The resource-specific properties for this resource.
+ public BrokerAuthorizationProperties Properties { get; set; }
+ /// Edge location of the resource.
+ public ExtendedLocation ExtendedLocation { get; set; }
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResource.Serialization.cs
new file mode 100644
index 000000000000..e2cf75c6f20f
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResource.Serialization.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ public partial class BrokerListenerResource : IJsonModel
+ {
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options);
+
+ BrokerListenerResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options);
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options);
+
+ BrokerListenerResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options);
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options);
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResource.cs
new file mode 100644
index 000000000000..659dca2f8000
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResource.cs
@@ -0,0 +1,348 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ ///
+ /// A Class representing a BrokerListenerResource 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 GetBrokerListenerResource method.
+ /// Otherwise you can get one from its parent resource using the GetBrokerListenerResource method.
+ ///
+ public partial class BrokerListenerResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ /// The subscriptionId.
+ /// The resourceGroupName.
+ /// The instanceName.
+ /// The brokerName.
+ /// The listenerName.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName, string listenerName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _brokerListenerResourceBrokerListenerClientDiagnostics;
+ private readonly BrokerListenerRestOperations _brokerListenerResourceBrokerListenerRestClient;
+ private readonly BrokerListenerResourceData _data;
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/brokers/listeners";
+
+ /// Initializes a new instance of the class for mocking.
+ protected BrokerListenerResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal BrokerListenerResource(ArmClient client, BrokerListenerResourceData 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 BrokerListenerResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _brokerListenerResourceBrokerListenerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string brokerListenerResourceBrokerListenerApiVersion);
+ _brokerListenerResourceBrokerListenerRestClient = new BrokerListenerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerListenerResourceBrokerListenerApiVersion);
+#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 BrokerListenerResourceData 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 BrokerListenerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _brokerListenerResourceBrokerListenerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerListenerResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a BrokerListenerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _brokerListenerResourceBrokerListenerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerListenerResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a BrokerListenerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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 = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _brokerListenerResourceBrokerListenerRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ var operation = new IoTOperationsArmOperation(_brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, _brokerListenerResourceBrokerListenerRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, 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 BrokerListenerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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 = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = _brokerListenerResourceBrokerListenerRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken);
+ var operation = new IoTOperationsArmOperation(_brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, _brokerListenerResourceBrokerListenerRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a BrokerListenerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(WaitUntil waitUntil, BrokerListenerResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResource.Update");
+ scope.Start();
+ try
+ {
+ var response = await _brokerListenerResourceBrokerListenerRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);
+ var operation = new IoTOperationsArmOperation(new BrokerListenerResourceOperationSource(Client), _brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, _brokerListenerResourceBrokerListenerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a BrokerListenerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation Update(WaitUntil waitUntil, BrokerListenerResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResource.Update");
+ scope.Start();
+ try
+ {
+ var response = _brokerListenerResourceBrokerListenerRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken);
+ var operation = new IoTOperationsArmOperation(new BrokerListenerResourceOperationSource(Client), _brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, _brokerListenerResourceBrokerListenerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceCollection.cs
new file mode 100644
index 000000000000..e9c1a8c1dbb5
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceCollection.cs
@@ -0,0 +1,493 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Autorest.CSharp.Core;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ ///
+ /// 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 GetBrokerListenerResources method from an instance of .
+ ///
+ public partial class BrokerListenerResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _brokerListenerResourceBrokerListenerClientDiagnostics;
+ private readonly BrokerListenerRestOperations _brokerListenerResourceBrokerListenerRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected BrokerListenerResourceCollection()
+ {
+ }
+
+ /// 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 BrokerListenerResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _brokerListenerResourceBrokerListenerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", BrokerListenerResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(BrokerListenerResource.ResourceType, out string brokerListenerResourceBrokerListenerApiVersion);
+ _brokerListenerResourceBrokerListenerRestClient = new BrokerListenerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerListenerResourceBrokerListenerApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != BrokerResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BrokerResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Create a BrokerListenerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Name of Instance broker listener resource.
+ /// 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 listenerName, BrokerListenerResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _brokerListenerResourceBrokerListenerRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, data, cancellationToken).ConfigureAwait(false);
+ var operation = new IoTOperationsArmOperation(new BrokerListenerResourceOperationSource(Client), _brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, _brokerListenerResourceBrokerListenerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a BrokerListenerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Name of Instance broker listener resource.
+ /// 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 listenerName, BrokerListenerResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _brokerListenerResourceBrokerListenerRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, data, cancellationToken);
+ var operation = new IoTOperationsArmOperation(new BrokerListenerResourceOperationSource(Client), _brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, _brokerListenerResourceBrokerListenerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a BrokerListenerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker listener resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string listenerName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName));
+
+ using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _brokerListenerResourceBrokerListenerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerListenerResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a BrokerListenerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker listener resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string listenerName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName));
+
+ using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _brokerListenerResourceBrokerListenerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerListenerResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List BrokerListenerResource resources by BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListenerResource_ListByResourceGroup
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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) => _brokerListenerResourceBrokerListenerRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerListenerResourceBrokerListenerRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BrokerListenerResource(Client, BrokerListenerResourceData.DeserializeBrokerListenerResourceData(e)), _brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, "BrokerListenerResourceCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List BrokerListenerResource resources by BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListenerResource_ListByResourceGroup
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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) => _brokerListenerResourceBrokerListenerRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerListenerResourceBrokerListenerRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BrokerListenerResource(Client, BrokerListenerResourceData.DeserializeBrokerListenerResourceData(e)), _brokerListenerResourceBrokerListenerClientDiagnostics, Pipeline, "BrokerListenerResourceCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker listener resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string listenerName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName));
+
+ using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _brokerListenerResourceBrokerListenerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, 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.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker listener resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string listenerName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName));
+
+ using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _brokerListenerResourceBrokerListenerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, 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.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker listener resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetIfExistsAsync(string listenerName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName));
+
+ using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = await _brokerListenerResourceBrokerListenerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new BrokerListenerResource(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.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker listener resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual NullableResponse GetIfExists(string listenerName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(listenerName, nameof(listenerName));
+
+ using var scope = _brokerListenerResourceBrokerListenerClientDiagnostics.CreateScope("BrokerListenerResourceCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = _brokerListenerResourceBrokerListenerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, listenerName, cancellationToken: cancellationToken);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new BrokerListenerResource(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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceData.Serialization.cs
new file mode 100644
index 000000000000..ccf986d0675c
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceData.Serialization.cs
@@ -0,0 +1,191 @@
+// 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.IoTOperations.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ public partial class BrokerListenerResourceData : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(BrokerListenerResourceData)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ if (Optional.IsDefined(Properties))
+ {
+ writer.WritePropertyName("properties"u8);
+ writer.WriteObjectValue(Properties, options);
+ }
+ writer.WritePropertyName("extendedLocation"u8);
+ writer.WriteObjectValue(ExtendedLocation, options);
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("id"u8);
+ writer.WriteStringValue(Id);
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(ResourceType);
+ }
+ if (options.Format != "W" && Optional.IsDefined(SystemData))
+ {
+ writer.WritePropertyName("systemData"u8);
+ JsonSerializer.Serialize(writer, SystemData);
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ BrokerListenerResourceData 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(BrokerListenerResourceData)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeBrokerListenerResourceData(document.RootElement, options);
+ }
+
+ internal static BrokerListenerResourceData DeserializeBrokerListenerResourceData(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ BrokerListenerProperties properties = default;
+ ExtendedLocation extendedLocation = 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 = BrokerListenerProperties.DeserializeBrokerListenerProperties(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("extendedLocation"u8))
+ {
+ extendedLocation = ExtendedLocation.DeserializeExtendedLocation(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 BrokerListenerResourceData(
+ id,
+ name,
+ type,
+ systemData,
+ properties,
+ extendedLocation,
+ serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(BrokerListenerResourceData)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ BrokerListenerResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeBrokerListenerResourceData(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(BrokerListenerResourceData)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceData.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceData.cs
new file mode 100644
index 000000000000..e78c861ec340
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerListenerResourceData.cs
@@ -0,0 +1,89 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using Azure.Core;
+using Azure.ResourceManager.IoTOperations.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ ///
+ /// A class representing the BrokerListenerResource data model.
+ /// Instance broker resource
+ ///
+ public partial class BrokerListenerResourceData : 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 .
+ /// Edge location of the resource.
+ /// is null.
+ public BrokerListenerResourceData(ExtendedLocation extendedLocation)
+ {
+ Argument.AssertNotNull(extendedLocation, nameof(extendedLocation));
+
+ ExtendedLocation = extendedLocation;
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// Edge location of the resource.
+ /// Keeps track of any properties unknown to the library.
+ internal BrokerListenerResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, BrokerListenerProperties properties, ExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData)
+ {
+ Properties = properties;
+ ExtendedLocation = extendedLocation;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal BrokerListenerResourceData()
+ {
+ }
+
+ /// The resource-specific properties for this resource.
+ public BrokerListenerProperties Properties { get; set; }
+ /// Edge location of the resource.
+ public ExtendedLocation ExtendedLocation { get; set; }
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResource.Serialization.cs
new file mode 100644
index 000000000000..1c57df972270
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResource.Serialization.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ public partial class BrokerResource : IJsonModel
+ {
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options);
+
+ BrokerResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options);
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options);
+
+ BrokerResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options);
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options);
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResource.cs
new file mode 100644
index 000000000000..c818dff510f8
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResource.cs
@@ -0,0 +1,554 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ ///
+ /// A Class representing a BrokerResource 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 GetBrokerResource method.
+ /// Otherwise you can get one from its parent resource using the GetBrokerResource method.
+ ///
+ public partial class BrokerResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ /// The subscriptionId.
+ /// The resourceGroupName.
+ /// The instanceName.
+ /// The brokerName.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string brokerName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _brokerResourceBrokerClientDiagnostics;
+ private readonly BrokerRestOperations _brokerResourceBrokerRestClient;
+ private readonly BrokerResourceData _data;
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/brokers";
+
+ /// Initializes a new instance of the class for mocking.
+ protected BrokerResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal BrokerResource(ArmClient client, BrokerResourceData 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 BrokerResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _brokerResourceBrokerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string brokerResourceBrokerApiVersion);
+ _brokerResourceBrokerRestClient = new BrokerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerResourceBrokerApiVersion);
+#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 BrokerResourceData Data
+ {
+ get
+ {
+ if (!HasData)
+ throw new InvalidOperationException("The current instance does not have data, you must call Get first.");
+ return _data;
+ }
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id));
+ }
+
+ /// Gets a collection of BrokerListenerResources in the BrokerResource.
+ /// An object representing collection of BrokerListenerResources and their operations over a BrokerListenerResource.
+ public virtual BrokerListenerResourceCollection GetBrokerListenerResources()
+ {
+ return GetCachedClient(client => new BrokerListenerResourceCollection(client, Id));
+ }
+
+ ///
+ /// Get a BrokerListenerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker listener resource.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual async Task> GetBrokerListenerResourceAsync(string listenerName, CancellationToken cancellationToken = default)
+ {
+ return await GetBrokerListenerResources().GetAsync(listenerName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get a BrokerListenerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/listeners/{listenerName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerListener_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker listener resource.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual Response GetBrokerListenerResource(string listenerName, CancellationToken cancellationToken = default)
+ {
+ return GetBrokerListenerResources().Get(listenerName, cancellationToken);
+ }
+
+ /// Gets a collection of BrokerAuthenticationResources in the BrokerResource.
+ /// An object representing collection of BrokerAuthenticationResources and their operations over a BrokerAuthenticationResource.
+ public virtual BrokerAuthenticationResourceCollection GetBrokerAuthenticationResources()
+ {
+ return GetCachedClient(client => new BrokerAuthenticationResourceCollection(client, Id));
+ }
+
+ ///
+ /// Get a BrokerAuthenticationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authentication resource.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual async Task> GetBrokerAuthenticationResourceAsync(string authenticationName, CancellationToken cancellationToken = default)
+ {
+ return await GetBrokerAuthenticationResources().GetAsync(authenticationName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get a BrokerAuthenticationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthentication_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authentication resource.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual Response GetBrokerAuthenticationResource(string authenticationName, CancellationToken cancellationToken = default)
+ {
+ return GetBrokerAuthenticationResources().Get(authenticationName, cancellationToken);
+ }
+
+ /// Gets a collection of BrokerAuthorizationResources in the BrokerResource.
+ /// An object representing collection of BrokerAuthorizationResources and their operations over a BrokerAuthorizationResource.
+ public virtual BrokerAuthorizationResourceCollection GetBrokerAuthorizationResources()
+ {
+ return GetCachedClient(client => new BrokerAuthorizationResourceCollection(client, Id));
+ }
+
+ ///
+ /// Get a BrokerAuthorizationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authorization resource.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual async Task> GetBrokerAuthorizationResourceAsync(string authorizationName, CancellationToken cancellationToken = default)
+ {
+ return await GetBrokerAuthorizationResources().GetAsync(authorizationName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get a BrokerAuthorizationResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authorizations/{authorizationName}
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerAuthorization_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of Instance broker authorization resource.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual Response GetBrokerAuthorizationResource(string authorizationName, CancellationToken cancellationToken = default)
+ {
+ return GetBrokerAuthorizationResources().Get(authorizationName, cancellationToken);
+ }
+
+ ///
+ /// Get a BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}
+ ///
+ /// -
+ /// Operation Id
+ /// Broker_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _brokerResourceBrokerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}
+ ///
+ /// -
+ /// Operation Id
+ /// Broker_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _brokerResourceBrokerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}
+ ///
+ /// -
+ /// Operation Id
+ /// Broker_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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 = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _brokerResourceBrokerRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ var operation = new IoTOperationsArmOperation(_brokerResourceBrokerClientDiagnostics, Pipeline, _brokerResourceBrokerRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}
+ ///
+ /// -
+ /// Operation Id
+ /// Broker_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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 = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = _brokerResourceBrokerRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ var operation = new IoTOperationsArmOperation(_brokerResourceBrokerClientDiagnostics, Pipeline, _brokerResourceBrokerRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}
+ ///
+ /// -
+ /// Operation Id
+ /// Broker_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(WaitUntil waitUntil, BrokerResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResource.Update");
+ scope.Start();
+ try
+ {
+ var response = await _brokerResourceBrokerRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);
+ var operation = new IoTOperationsArmOperation(new BrokerResourceOperationSource(Client), _brokerResourceBrokerClientDiagnostics, Pipeline, _brokerResourceBrokerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}
+ ///
+ /// -
+ /// Operation Id
+ /// Broker_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation Update(WaitUntil waitUntil, BrokerResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResource.Update");
+ scope.Start();
+ try
+ {
+ var response = _brokerResourceBrokerRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken);
+ var operation = new IoTOperationsArmOperation(new BrokerResourceOperationSource(Client), _brokerResourceBrokerClientDiagnostics, Pipeline, _brokerResourceBrokerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceCollection.cs
new file mode 100644
index 000000000000..ed7babb2fee2
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceCollection.cs
@@ -0,0 +1,493 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Autorest.CSharp.Core;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ ///
+ /// 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 GetBrokerResources method from an instance of .
+ ///
+ public partial class BrokerResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _brokerResourceBrokerClientDiagnostics;
+ private readonly BrokerRestOperations _brokerResourceBrokerRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected BrokerResourceCollection()
+ {
+ }
+
+ /// 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 BrokerResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _brokerResourceBrokerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", BrokerResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(BrokerResource.ResourceType, out string brokerResourceBrokerApiVersion);
+ _brokerResourceBrokerRestClient = new BrokerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, brokerResourceBrokerApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != InstanceResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, InstanceResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Create a BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}
+ ///
+ /// -
+ /// Operation Id
+ /// Broker_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Name of broker.
+ /// 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 brokerName, BrokerResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _brokerResourceBrokerRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, data, cancellationToken).ConfigureAwait(false);
+ var operation = new IoTOperationsArmOperation(new BrokerResourceOperationSource(Client), _brokerResourceBrokerClientDiagnostics, Pipeline, _brokerResourceBrokerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}
+ ///
+ /// -
+ /// Operation Id
+ /// Broker_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Name of broker.
+ /// 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 brokerName, BrokerResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _brokerResourceBrokerRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, data, cancellationToken);
+ var operation = new IoTOperationsArmOperation(new BrokerResourceOperationSource(Client), _brokerResourceBrokerClientDiagnostics, Pipeline, _brokerResourceBrokerRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}
+ ///
+ /// -
+ /// Operation Id
+ /// Broker_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of broker.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string brokerName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName));
+
+ using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _brokerResourceBrokerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a BrokerResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}
+ ///
+ /// -
+ /// Operation Id
+ /// Broker_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of broker.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string brokerName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName));
+
+ using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _brokerResourceBrokerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new BrokerResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List BrokerResource resources by InstanceResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerResource_ListByResourceGroup
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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) => _brokerResourceBrokerRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerResourceBrokerRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BrokerResource(Client, BrokerResourceData.DeserializeBrokerResourceData(e)), _brokerResourceBrokerClientDiagnostics, Pipeline, "BrokerResourceCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List BrokerResource resources by InstanceResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers
+ ///
+ /// -
+ /// Operation Id
+ /// BrokerResource_ListByResourceGroup
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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) => _brokerResourceBrokerRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _brokerResourceBrokerRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BrokerResource(Client, BrokerResourceData.DeserializeBrokerResourceData(e)), _brokerResourceBrokerClientDiagnostics, Pipeline, "BrokerResourceCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}
+ ///
+ /// -
+ /// Operation Id
+ /// Broker_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of broker.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string brokerName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName));
+
+ using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _brokerResourceBrokerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, 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.IoTOperations/instances/{instanceName}/brokers/{brokerName}
+ ///
+ /// -
+ /// Operation Id
+ /// Broker_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of broker.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string brokerName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName));
+
+ using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _brokerResourceBrokerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, 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.IoTOperations/instances/{instanceName}/brokers/{brokerName}
+ ///
+ /// -
+ /// Operation Id
+ /// Broker_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of broker.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetIfExistsAsync(string brokerName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName));
+
+ using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = await _brokerResourceBrokerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new BrokerResource(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.IoTOperations/instances/{instanceName}/brokers/{brokerName}
+ ///
+ /// -
+ /// Operation Id
+ /// Broker_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of broker.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual NullableResponse GetIfExists(string brokerName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(brokerName, nameof(brokerName));
+
+ using var scope = _brokerResourceBrokerClientDiagnostics.CreateScope("BrokerResourceCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = _brokerResourceBrokerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, brokerName, cancellationToken: cancellationToken);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new BrokerResource(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/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceData.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceData.Serialization.cs
new file mode 100644
index 000000000000..21ee52effeb6
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceData.Serialization.cs
@@ -0,0 +1,191 @@
+// 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.IoTOperations.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ public partial class BrokerResourceData : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(BrokerResourceData)} does not support writing '{format}' format.");
+ }
+
+ writer.WriteStartObject();
+ if (Optional.IsDefined(Properties))
+ {
+ writer.WritePropertyName("properties"u8);
+ writer.WriteObjectValue(Properties, options);
+ }
+ writer.WritePropertyName("extendedLocation"u8);
+ writer.WriteObjectValue(ExtendedLocation, options);
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("id"u8);
+ writer.WriteStringValue(Id);
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(ResourceType);
+ }
+ if (options.Format != "W" && Optional.IsDefined(SystemData))
+ {
+ writer.WritePropertyName("systemData"u8);
+ JsonSerializer.Serialize(writer, SystemData);
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ writer.WriteEndObject();
+ }
+
+ BrokerResourceData 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(BrokerResourceData)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeBrokerResourceData(document.RootElement, options);
+ }
+
+ internal static BrokerResourceData DeserializeBrokerResourceData(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ BrokerProperties properties = default;
+ ExtendedLocation extendedLocation = 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 = BrokerProperties.DeserializeBrokerProperties(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("extendedLocation"u8))
+ {
+ extendedLocation = ExtendedLocation.DeserializeExtendedLocation(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 BrokerResourceData(
+ id,
+ name,
+ type,
+ systemData,
+ properties,
+ extendedLocation,
+ serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(BrokerResourceData)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ BrokerResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data);
+ return DeserializeBrokerResourceData(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(BrokerResourceData)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceData.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceData.cs
new file mode 100644
index 000000000000..f53dd7c8822a
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/BrokerResourceData.cs
@@ -0,0 +1,89 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using Azure.Core;
+using Azure.ResourceManager.IoTOperations.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ ///
+ /// A class representing the BrokerResource data model.
+ /// Instance broker resource
+ ///
+ public partial class BrokerResourceData : 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 .
+ /// Edge location of the resource.
+ /// is null.
+ public BrokerResourceData(ExtendedLocation extendedLocation)
+ {
+ Argument.AssertNotNull(extendedLocation, nameof(extendedLocation));
+
+ ExtendedLocation = extendedLocation;
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// Edge location of the resource.
+ /// Keeps track of any properties unknown to the library.
+ internal BrokerResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, BrokerProperties properties, ExtendedLocation extendedLocation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData)
+ {
+ Properties = properties;
+ ExtendedLocation = extendedLocation;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal BrokerResourceData()
+ {
+ }
+
+ /// The resource-specific properties for this resource.
+ public BrokerProperties Properties { get; set; }
+ /// Edge location of the resource.
+ public ExtendedLocation ExtendedLocation { get; set; }
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResource.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResource.Serialization.cs
new file mode 100644
index 000000000000..f76b1d2fb551
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResource.Serialization.cs
@@ -0,0 +1,26 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ public partial class DataflowEndpointResource : IJsonModel
+ {
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options);
+
+ DataflowEndpointResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options);
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options);
+
+ DataflowEndpointResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options);
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options);
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResource.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResource.cs
new file mode 100644
index 000000000000..f62d6f376b78
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResource.cs
@@ -0,0 +1,347 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ ///
+ /// A Class representing a DataflowEndpointResource 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 GetDataflowEndpointResource method.
+ /// Otherwise you can get one from its parent resource using the GetDataflowEndpointResource method.
+ ///
+ public partial class DataflowEndpointResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ /// The subscriptionId.
+ /// The resourceGroupName.
+ /// The instanceName.
+ /// The dataflowEndpointName.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string instanceName, string dataflowEndpointName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _dataflowEndpointResourceDataflowEndpointClientDiagnostics;
+ private readonly DataflowEndpointRestOperations _dataflowEndpointResourceDataflowEndpointRestClient;
+ private readonly DataflowEndpointResourceData _data;
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.IoTOperations/instances/dataflowEndpoints";
+
+ /// Initializes a new instance of the class for mocking.
+ protected DataflowEndpointResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal DataflowEndpointResource(ArmClient client, DataflowEndpointResourceData 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 DataflowEndpointResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _dataflowEndpointResourceDataflowEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string dataflowEndpointResourceDataflowEndpointApiVersion);
+ _dataflowEndpointResourceDataflowEndpointRestClient = new DataflowEndpointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataflowEndpointResourceDataflowEndpointApiVersion);
+#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 DataflowEndpointResourceData 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 DataflowEndpointResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName}
+ ///
+ /// -
+ /// Operation Id
+ /// DataflowEndpoint_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _dataflowEndpointResourceDataflowEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DataflowEndpointResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a DataflowEndpointResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName}
+ ///
+ /// -
+ /// Operation Id
+ /// DataflowEndpoint_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _dataflowEndpointResourceDataflowEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DataflowEndpointResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a DataflowEndpointResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName}
+ ///
+ /// -
+ /// Operation Id
+ /// DataflowEndpoint_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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 = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _dataflowEndpointResourceDataflowEndpointRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ var operation = new IoTOperationsArmOperation(_dataflowEndpointResourceDataflowEndpointClientDiagnostics, Pipeline, _dataflowEndpointResourceDataflowEndpointRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a DataflowEndpointResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName}
+ ///
+ /// -
+ /// Operation Id
+ /// DataflowEndpoint_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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 = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = _dataflowEndpointResourceDataflowEndpointRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ var operation = new IoTOperationsArmOperation(_dataflowEndpointResourceDataflowEndpointClientDiagnostics, Pipeline, _dataflowEndpointResourceDataflowEndpointRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a DataflowEndpointResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName}
+ ///
+ /// -
+ /// Operation Id
+ /// DataflowEndpoint_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataflowEndpointResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResource.Update");
+ scope.Start();
+ try
+ {
+ var response = await _dataflowEndpointResourceDataflowEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);
+ var operation = new IoTOperationsArmOperation(new DataflowEndpointResourceOperationSource(Client), _dataflowEndpointResourceDataflowEndpointClientDiagnostics, Pipeline, _dataflowEndpointResourceDataflowEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a DataflowEndpointResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName}
+ ///
+ /// -
+ /// Operation Id
+ /// DataflowEndpoint_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation Update(WaitUntil waitUntil, DataflowEndpointResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResource.Update");
+ scope.Start();
+ try
+ {
+ var response = _dataflowEndpointResourceDataflowEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken);
+ var operation = new IoTOperationsArmOperation(new DataflowEndpointResourceOperationSource(Client), _dataflowEndpointResourceDataflowEndpointClientDiagnostics, Pipeline, _dataflowEndpointResourceDataflowEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResourceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResourceCollection.cs
new file mode 100644
index 000000000000..1e324839347a
--- /dev/null
+++ b/sdk/iotoperations/Azure.ResourceManager.IoTOperations/src/Generated/DataflowEndpointResourceCollection.cs
@@ -0,0 +1,493 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Autorest.CSharp.Core;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.IoTOperations
+{
+ ///
+ /// 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 GetDataflowEndpointResources method from an instance of .
+ ///
+ public partial class DataflowEndpointResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _dataflowEndpointResourceDataflowEndpointClientDiagnostics;
+ private readonly DataflowEndpointRestOperations _dataflowEndpointResourceDataflowEndpointRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected DataflowEndpointResourceCollection()
+ {
+ }
+
+ /// 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 DataflowEndpointResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _dataflowEndpointResourceDataflowEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.IoTOperations", DataflowEndpointResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(DataflowEndpointResource.ResourceType, out string dataflowEndpointResourceDataflowEndpointApiVersion);
+ _dataflowEndpointResourceDataflowEndpointRestClient = new DataflowEndpointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataflowEndpointResourceDataflowEndpointApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != InstanceResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, InstanceResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Create a DataflowEndpointResource
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/dataflowEndpoints/{dataflowEndpointName}
+ ///
+ /// -
+ /// Operation Id
+ /// DataflowEndpoint_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2024-08-15-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.
+ /// Name of Instance dataflowEndpoint resource.
+ /// 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 dataflowEndpointName, DataflowEndpointResourceData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(dataflowEndpointName, nameof(dataflowEndpointName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _dataflowEndpointResourceDataflowEndpointClientDiagnostics.CreateScope("DataflowEndpointResourceCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _dataflowEndpointResourceDataflowEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, data, cancellationToken).ConfigureAwait(false);
+ var operation = new IoTOperationsArmOperation(new DataflowEndpointResourceOperationSource(Client), _dataflowEndpointResourceDataflowEndpointClientDiagnostics, Pipeline, _dataflowEndpointResourceDataflowEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dataflowEndpointName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a DataflowEndpointResource
+ ///
+ /// -
+ ///