/// <summary> /// Creates a disposable DeviceClient from the specified connection string using the specified transport type /// </summary> /// <param name="connectionString">Connection string for the IoT hub (including DeviceId)</param> /// <param name="transportType">Specifies whether Http1, AMQP or MQTT transport is used, <see cref="TransportType"/></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, TransportType transportType, ClientOptions options = default) { return(Create(() => ClientFactory.CreateFromConnectionString(connectionString, transportType, options))); }
/// <summary> /// Creates a disposable DeviceClient from the specified connection string using the prioritized list of transports /// </summary> /// <param name="connectionString">Connection string for the IoT hub (without DeviceId)</param> /// <param name="deviceId">Id of the device</param> /// <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) { return(Create(() => ClientFactory.CreateFromConnectionString(connectionString, deviceId, transportSettings, options))); }
/// <summary> /// Create an Amqp ModuleClient from individual parameters /// </summary> /// <param name="hostname">The fully-qualified DNS hostname of IoT Hub</param> /// <param name="authenticationMethod">The authentication method that is used</param> /// <returns>ModuleClient</returns> public static ModuleClient Create(string hostname, IAuthenticationMethod authenticationMethod) { return(Create(() => ClientFactory.Create(hostname, authenticationMethod))); }
/// <summary> /// Create a ModuleClient from individual parameters /// </summary> /// <param name="hostname">The fully-qualified DNS hostname of IoT Hub</param> /// <param name="gatewayHostname">The fully-qualified DNS hostname of Gateway</param> /// <param name="authenticationMethod">The authentication method that is used</param> /// <param name="transportType">The transportType used (Http1 or Amqp)</param> /// <returns>ModuleClient</returns> public static ModuleClient Create(string hostname, string gatewayHostname, IAuthenticationMethod authenticationMethod, TransportType transportType) { return(Create(() => ClientFactory.Create(hostname, gatewayHostname, authenticationMethod, transportType))); }
/// <summary> /// Create ModuleClient from the specified connection string using a prioritized list of transports /// </summary> /// <param name="connectionString">Connection string for the IoT hub (with DeviceId)</param> /// <param name="transportSettings">Prioritized list of transports and their settings</param> /// <returns>ModuleClient</returns> public static ModuleClient CreateFromConnectionString(string connectionString, ITransportSettings[] transportSettings) { return(Create(() => ClientFactory.CreateFromConnectionString(connectionString, transportSettings))); }
/// <summary> /// Creates a ModuleClient instance in an IoT Edge deployment /// based on environment variables. /// </summary> /// <param name="transportType">Specifies whether Amqp or Http transport is used</param> /// <returns>ModuleClient instance</returns> public static Task <ModuleClient> CreateFromEnvironmentAsync(TransportType transportType) { return(CreateFromEnvironmentAsync(ClientFactory.GetTransportSettings(transportType))); }
/// <summary> /// Create a ModuleClient using Amqp transport from the specified connection string /// </summary> /// <param name="connectionString">Connection string for the IoT hub (including DeviceId)</param> /// <returns>ModuleClient</returns> public static ModuleClient CreateFromConnectionString(string connectionString) { return(Create(() => ClientFactory.CreateFromConnectionString(connectionString))); }
/// <summary> /// Creates a ModuleClient instance in an IoT Edge deployment /// based on environment variables. /// </summary> /// <param name="transportType">Specifies whether Amqp or Http transport is used</param> /// <param name="options">The options that allow configuration of the module client instance during initialization.</param> /// <returns>ModuleClient instance</returns> public static Task <ModuleClient> CreateFromEnvironmentAsync(TransportType transportType, ClientOptions options = default) { return(CreateFromEnvironmentAsync(ClientFactory.GetTransportSettings(transportType), options)); }
/// <summary> /// Create an Amqp DeviceClient from individual parameters /// </summary> /// <param name="hostname">The fully-qualified DNS hostname of IoT Hub</param> /// <param name="authenticationMethod">The authentication method that is used</param> /// <param name="gatewayHostname">The fully-qualified DNS hostname of Gateway</param> /// <returns>DeviceClient</returns> public static DeviceClient Create(string hostname, string gatewayHostname, IAuthenticationMethod authenticationMethod) { return(Create(() => ClientFactory.Create(hostname, gatewayHostname, authenticationMethod))); }
/// <summary> /// Create a ModuleClient from individual parameters /// </summary> /// <param name="hostname">The fully-qualified DNS hostname of IoT Hub</param> /// <param name="authenticationMethod">The authentication method that is used</param> /// <param name="transportSettings">Prioritized list of transportTypes and their settings</param> /// <returns>ModuleClient</returns> public static ModuleClient Create(string hostname, IAuthenticationMethod authenticationMethod, ITransportSettings[] transportSettings) { return(Create(() => ClientFactory.Create(hostname, authenticationMethod, transportSettings))); }
/// <summary> /// Create DeviceClient from the specified connection string using the specified transport type /// </summary> /// <param name="connectionString">IoT Hub-Scope Connection string for the IoT hub (without DeviceId)</param> /// <param name="deviceId">Id of the device</param> /// <param name="transportType">The transportType used (Http1 or Amqp)</param> /// <returns>DeviceClient</returns> public static DeviceClient CreateFromConnectionString(string connectionString, string deviceId, TransportType transportType) { return(Create(() => ClientFactory.CreateFromConnectionString(connectionString, deviceId, transportType))); }
/// <summary> /// Create a DeviceClient using Amqp transport from the specified connection string /// </summary> /// <param name="connectionString">IoT Hub-Scope Connection string for the IoT hub (without DeviceId)</param> /// <param name="deviceId">Id of the Device</param> /// <returns>DeviceClient</returns> public static DeviceClient CreateFromConnectionString(string connectionString, string deviceId) { return(Create(() => ClientFactory.CreateFromConnectionString(connectionString, deviceId))); }
/// <summary> /// Create an Amqp ModuleClient from individual parameters /// </summary> /// <param name="hostname">The fully-qualified DNS hostname of IoT Hub</param> /// <param name="authenticationMethod">The authentication method that is used</param> /// <param name="gatewayHostname">The fully-qualified DNS hostname of Gateway</param> /// <param name="options">The options that allow configuration of the module client instance during initialization.</param> /// <returns>ModuleClient</returns> public static ModuleClient Create(string hostname, string gatewayHostname, IAuthenticationMethod authenticationMethod, ClientOptions options = default) { return(Create(() => ClientFactory.Create(hostname, gatewayHostname, authenticationMethod, options))); }
/// <summary> /// Create a disposable DeviceClient from the specified parameters /// </summary> /// <param name="hostname">The fully-qualified DNS host name of IoT Hub</param> /// <param name="gatewayHostname">The fully-qualified DNS host name of Gateway</param> /// <param name="authenticationMethod">The authentication method that is used</param> /// <param name="transportType">The transportType used (Http1, AMQP or MQTT), <see cref="TransportType"/></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 Create(string hostname, string gatewayHostname, IAuthenticationMethod authenticationMethod, TransportType transportType, ClientOptions options = default) { return(Create(() => ClientFactory.Create(hostname, gatewayHostname, authenticationMethod, transportType, options))); }
/// <summary> /// Create ModuleClient from the specified connection string using the specified transport type /// </summary> /// <param name="connectionString">Connection string for the IoT hub (including DeviceId)</param> /// <param name="transportType">Specifies whether Amqp or Http transport is used</param> /// <returns>ModuleClient</returns> public static ModuleClient CreateFromConnectionString(string connectionString, TransportType transportType) { return(Create(() => ClientFactory.CreateFromConnectionString(connectionString, transportType))); }
/// <summary> /// Creates a disposable DeviceClient from the specified parameters /// </summary> /// <param name="hostname">The fully-qualified DNS host name of IoT Hub</param> /// <param name="authenticationMethod">The authentication method that is used</param> /// <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 Create(string hostname, IAuthenticationMethod authenticationMethod, ITransportSettings[] transportSettings, ClientOptions options = default) { return(Create(() => ClientFactory.Create(hostname, authenticationMethod, transportSettings, options))); }
/// <summary> /// Create a ModuleClient using Amqp transport from the specified connection string /// </summary> /// <param name="connectionString">Connection string for the IoT hub (including DeviceId)</param> /// <param name="options">The options that allow configuration of the module client instance during initialization.</param> /// <returns>ModuleClient</returns> public static ModuleClient CreateFromConnectionString(string connectionString, ClientOptions options = default) { return(Create(() => ClientFactory.CreateFromConnectionString(connectionString, options))); }