forked from Azure/azure-sdk-for-net
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REST Spec PR 'Azure/azure-rest-api-specs#5544' REST Spec PR Author 'reshantchandra' REST Spec PR Last commit
- Loading branch information
Showing
2 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
102 changes: 102 additions & 0 deletions
102
src/SDKs/IotHub/Management.IotHub/Generated/Models/EnrichmentProperties.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters