Skip to content

Commit

Permalink
.NET SDK Resource Provider:'IotHub'
Browse files Browse the repository at this point in the history
REST Spec PR 'Azure/azure-rest-api-specs#5544'
REST Spec PR Author 'reshantchandra'
REST Spec PR Last commit
  • Loading branch information
adxsdknet committed Apr 8, 2019
1 parent 3a20505 commit b943018
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// <auto-generated>
// 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.
// </auto-generated>

namespace Microsoft.Azure.Management.IotHub.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

/// <summary>
/// The properties of an enrichment that your IoT hub applies to messages
/// delivered to endpoints.
/// </summary>
public partial class EnrichmentProperties
{
/// <summary>
/// Initializes a new instance of the EnrichmentProperties class.
/// </summary>
public EnrichmentProperties()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the EnrichmentProperties class.
/// </summary>
/// <param name="key">The key or name for the enrichment
/// property.</param>
/// <param name="value">The value for the enrichment property.</param>
/// <param name="endpointNames">The list of endpoints for which the
/// enrichment is applied to the message.</param>
public EnrichmentProperties(string key, string value, IList<string> endpointNames)
{
Key = key;
Value = value;
EndpointNames = endpointNames;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets the key or name for the enrichment property.
/// </summary>
[JsonProperty(PropertyName = "key")]
public string Key { get; set; }

/// <summary>
/// Gets or sets the value for the enrichment property.
/// </summary>
[JsonProperty(PropertyName = "value")]
public string Value { get; set; }

/// <summary>
/// Gets or sets the list of endpoints for which the enrichment is
/// applied to the message.
/// </summary>
[JsonProperty(PropertyName = "endpointNames")]
public IList<string> EndpointNames { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
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);
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.</param>
public RoutingProperties(RoutingEndpoints endpoints = default(RoutingEndpoints), IList<RouteProperties> routes = default(IList<RouteProperties>), FallbackRouteProperties fallbackRoute = default(FallbackRouteProperties))
/// <param name="enrichments">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</param>
public RoutingProperties(RoutingEndpoints endpoints = default(RoutingEndpoints), IList<RouteProperties> routes = default(IList<RouteProperties>), FallbackRouteProperties fallbackRoute = default(FallbackRouteProperties), IList<EnrichmentProperties> enrichments = default(IList<EnrichmentProperties>))
{
Endpoints = endpoints;
Routes = routes;
FallbackRoute = fallbackRoute;
Enrichments = enrichments;
CustomInit();
}

Expand Down Expand Up @@ -80,6 +85,14 @@ public RoutingProperties()
[JsonProperty(PropertyName = "fallbackRoute")]
public FallbackRouteProperties FallbackRoute { get; set; }

/// <summary>
/// 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
/// </summary>
[JsonProperty(PropertyName = "enrichments")]
public IList<EnrichmentProperties> Enrichments { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
Expand All @@ -102,6 +115,16 @@ public virtual void Validate()
{
FallbackRoute.Validate();
}
if (Enrichments != null)
{
foreach (var element1 in Enrichments)
{
if (element1 != null)
{
element1.Validate();
}
}
}
}
}
}

0 comments on commit b943018

Please sign in to comment.