Skip to content

Commit

Permalink
Merge branch 'master' into drwill/method-null-payload
Browse files Browse the repository at this point in the history
  • Loading branch information
David R. Williamson authored May 7, 2021
2 parents 24de9bb + c779834 commit 4118453
Show file tree
Hide file tree
Showing 7 changed files with 265 additions and 94 deletions.
3 changes: 2 additions & 1 deletion iothub/device/src/AmqpTransportSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using Microsoft.Azure.Devices.Shared;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
Expand All @@ -26,7 +27,7 @@ public sealed class AmqpTransportSettings : ITransportSettings
/// <summary>
/// To enable certificate revocation check. Default to be false.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage(
[SuppressMessage(
"Performance",
"CA1822:Mark members as static",
Justification = "Cannot change public property in public facing classes.")]
Expand Down
130 changes: 96 additions & 34 deletions iothub/device/src/ClientFactory.cs

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions iothub/device/src/DeviceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ public static DeviceClient CreateFromConnectionString(string connectionString, s
/// <param name="transportSettings">Prioritized list of transports and their settings</param>
/// <param name="options">The options that allow configuration of the device client instance during initialization.</param>
/// <returns>A disposable DeviceClient instance</returns>
public static DeviceClient CreateFromConnectionString(string connectionString,
ITransportSettings[] transportSettings, ClientOptions options = default)
public static DeviceClient CreateFromConnectionString(
string connectionString,
ITransportSettings[] transportSettings,
ClientOptions options = default)
{
return Create(() => ClientFactory.CreateFromConnectionString(connectionString, transportSettings, options));
}
Expand All @@ -187,8 +189,11 @@ public static DeviceClient CreateFromConnectionString(string connectionString,
/// <param name="transportSettings">Prioritized list of transportTypes and their settings</param>
/// <param name="options">The options that allow configuration of the device client instance during initialization.</param>
/// <returns>A disposable DeviceClient instance</returns>
public static DeviceClient CreateFromConnectionString(string connectionString, string deviceId,
ITransportSettings[] transportSettings, ClientOptions options = default)
public static DeviceClient CreateFromConnectionString(
string connectionString,
string deviceId,
ITransportSettings[] transportSettings,
ClientOptions options = default)
{
return Create(() => ClientFactory.CreateFromConnectionString(connectionString, deviceId, transportSettings, options));
}
Expand Down
199 changes: 144 additions & 55 deletions iothub/device/tests/DeviceClientTests.cs

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions iothub/service/src/Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ public Device(string id)
/// </summary>
/// <remarks>
/// For leaf devices, the value to set a parent edge device can be retrieved from the parent edge device's <see cref="Scope"/> property.
///
/// For more information, see <see href="https://docs.microsoft.com/azure/iot-edge/iot-edge-as-gateway?view=iotedge-2020-11#parent-and-child-relationships"/>.
/// </remarks>
[JsonProperty(PropertyName = "deviceScope", NullValueHandling = NullValueHandling.Ignore)]
public virtual string Scope { get; set; }
Expand All @@ -128,6 +130,8 @@ public Device(string id)
/// For leaf devices, this could be set to the same value as <see cref="Scope"/> or left for the service to copy over.
///
/// For now, this list can only have 1 element in the collection.
///
/// For more information, see <see href="https://docs.microsoft.com/azure/iot-edge/iot-edge-as-gateway?view=iotedge-2020-11#parent-and-child-relationships"/>.
/// </remarks>
[JsonProperty(PropertyName = "parentScopes", NullValueHandling = NullValueHandling.Ignore)]
public virtual IList<string> ParentScopes { get; internal set; } = new List<string>();
Expand Down
6 changes: 6 additions & 0 deletions shared/src/Twin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,19 @@ public Twin(TwinProperties twinProperties)
/// <summary>
/// The scope of the device. Auto-generated and immutable for edge devices and modifiable in leaf devices to create child/parent relationship.
/// </summary>
/// <remarks>
/// For more information, see <see href="https://docs.microsoft.com/azure/iot-edge/iot-edge-as-gateway?view=iotedge-2020-11#parent-and-child-relationships"/>.
/// </remarks>
[DefaultValue(null)]
[JsonProperty(DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
public string DeviceScope { get; internal set; }

/// <summary>
/// The scopes of the upper level edge devices if applicable. Only available for edge devices.
/// </summary>
/// <remarks>
/// For more information, see <see href="https://docs.microsoft.com/azure/iot-edge/iot-edge-as-gateway?view=iotedge-2020-11#parent-and-child-relationships"/>.
/// </remarks>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public virtual IReadOnlyList<string> ParentScopes { get; internal set; } = new List<string>();

Expand Down
4 changes: 4 additions & 0 deletions vsts/test-release-nuget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ jobs:
E2E_IKEY: $(E2E-IKEY)
FRAMEWORK: $(FRAMEWORK)
AZURE_IOT_LOCALPACKAGES: $(Build.ArtifactStagingDirectory)/nuget
IOTHUB_CLIENT_ID: $(IOTHUB-CLIENT-ID)
IOTHUB_CLIENT_SECRET: $(IOTHUB-CLIENT-SECRET)

- task: CopyFiles@2
displayName: 'Copy files to the artifacts folder'
Expand Down Expand Up @@ -204,6 +206,8 @@ jobs:
E2E_IKEY: $(E2E-IKEY)
FRAMEWORK: $(FRAMEWORK)
AZURE_IOT_LOCALPACKAGES: $(Build.ArtifactStagingDirectory)/nuget
IOTHUB_CLIENT_ID: $(IOTHUB-CLIENT-ID)
IOTHUB_CLIENT_SECRET: $(IOTHUB-CLIENT-SECRET)

- task: CopyFiles@2
displayName: 'Copy TRX files to the artifacts folder'
Expand Down

0 comments on commit 4118453

Please sign in to comment.