diff --git a/src/SDKs/IotHub/Management.IotHub/Generated/Models/EnrichmentProperties.cs b/src/SDKs/IotHub/Management.IotHub/Generated/Models/EnrichmentProperties.cs new file mode 100644 index 000000000000..b277ee3a4127 --- /dev/null +++ b/src/SDKs/IotHub/Management.IotHub/Generated/Models/EnrichmentProperties.cs @@ -0,0 +1,102 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.IotHub.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The properties of an enrichment that your IoT hub applies to messages + /// delivered to endpoints. + /// + public partial class EnrichmentProperties + { + /// + /// Initializes a new instance of the EnrichmentProperties class. + /// + public EnrichmentProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EnrichmentProperties class. + /// + /// The key or name for the enrichment + /// property. + /// The value for the enrichment property. + /// The list of endpoints for which the + /// enrichment is applied to the message. + public EnrichmentProperties(string key, string value, IList endpointNames) + { + Key = key; + Value = value; + EndpointNames = endpointNames; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the key or name for the enrichment property. + /// + [JsonProperty(PropertyName = "key")] + public string Key { get; set; } + + /// + /// Gets or sets the value for the enrichment property. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Gets or sets the list of endpoints for which the enrichment is + /// applied to the message. + /// + [JsonProperty(PropertyName = "endpointNames")] + public IList EndpointNames { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Key == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Key"); + } + if (Value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + } + if (EndpointNames == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "EndpointNames"); + } + if (EndpointNames != null) + { + if (EndpointNames.Count < 1) + { + throw new ValidationException(ValidationRules.MinItems, "EndpointNames", 1); + } + } + } + } +} diff --git a/src/SDKs/IotHub/Management.IotHub/Generated/Models/RoutingProperties.cs b/src/SDKs/IotHub/Management.IotHub/Generated/Models/RoutingProperties.cs index 1c77b24f666e..be3a8272ff3f 100644 --- a/src/SDKs/IotHub/Management.IotHub/Generated/Models/RoutingProperties.cs +++ b/src/SDKs/IotHub/Management.IotHub/Generated/Models/RoutingProperties.cs @@ -42,11 +42,16 @@ public RoutingProperties() /// this property is not set, the messages which do not meet any of the /// conditions specified in the 'routes' section get routed to the /// built-in eventhub endpoint. - public RoutingProperties(RoutingEndpoints endpoints = default(RoutingEndpoints), IList routes = default(IList), FallbackRouteProperties fallbackRoute = default(FallbackRouteProperties)) + /// The list of user-provided enrichments + /// that the IoT hub applies to messages to be delivered to built-in + /// and custom endpoints. See: + /// https://aka.ms/telemetryoneventgrid + public RoutingProperties(RoutingEndpoints endpoints = default(RoutingEndpoints), IList routes = default(IList), FallbackRouteProperties fallbackRoute = default(FallbackRouteProperties), IList enrichments = default(IList)) { Endpoints = endpoints; Routes = routes; FallbackRoute = fallbackRoute; + Enrichments = enrichments; CustomInit(); } @@ -80,6 +85,14 @@ public RoutingProperties() [JsonProperty(PropertyName = "fallbackRoute")] public FallbackRouteProperties FallbackRoute { get; set; } + /// + /// Gets or sets the list of user-provided enrichments that the IoT hub + /// applies to messages to be delivered to built-in and custom + /// endpoints. See: https://aka.ms/telemetryoneventgrid + /// + [JsonProperty(PropertyName = "enrichments")] + public IList Enrichments { get; set; } + /// /// Validate the object. /// @@ -102,6 +115,16 @@ public virtual void Validate() { FallbackRoute.Validate(); } + if (Enrichments != null) + { + foreach (var element1 in Enrichments) + { + if (element1 != null) + { + element1.Validate(); + } + } + } } } }