diff --git a/eng/Directory.Build.Common.props b/eng/Directory.Build.Common.props index a97ab4947ab0..7344dbe5196e 100644 --- a/eng/Directory.Build.Common.props +++ b/eng/Directory.Build.Common.props @@ -3,7 +3,7 @@ true - 3.0.0-beta.20210319.1 + 3.0.0-beta.20210504.1 true diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 492e1917e8ca..62c6cc147991 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -128,7 +128,7 @@ All should have PrivateAssets="All" set so they don't become pacakge dependencies --> - + diff --git a/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs b/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs index 0175612ad0b6..7824a7cdcaef 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs @@ -1890,10 +1890,28 @@ public ContainerServiceLinuxProfile(string adminUsername, Azure.ResourceManager. public partial class ContainerServiceMasterProfile { public ContainerServiceMasterProfile(string dnsPrefix) { } - public Azure.ResourceManager.Compute.Models.Enum31? Count { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.ContainerServiceMasterProfileCount? Count { get { throw null; } set { } } public string DnsPrefix { get { throw null; } set { } } public string Fqdn { get { throw null; } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ContainerServiceMasterProfileCount : System.IEquatable + { + private readonly int _dummyPrimitive; + public ContainerServiceMasterProfileCount(int value) { throw null; } + public static Azure.ResourceManager.Compute.Models.ContainerServiceMasterProfileCount Five { get { throw null; } } + public static Azure.ResourceManager.Compute.Models.ContainerServiceMasterProfileCount One { get { throw null; } } + public static Azure.ResourceManager.Compute.Models.ContainerServiceMasterProfileCount Three { get { throw null; } } + public bool Equals(Azure.ResourceManager.Compute.Models.ContainerServiceMasterProfileCount other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Compute.Models.ContainerServiceMasterProfileCount left, Azure.ResourceManager.Compute.Models.ContainerServiceMasterProfileCount right) { throw null; } + public static implicit operator Azure.ResourceManager.Compute.Models.ContainerServiceMasterProfileCount (int value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Compute.Models.ContainerServiceMasterProfileCount left, Azure.ResourceManager.Compute.Models.ContainerServiceMasterProfileCount right) { throw null; } + public override string ToString() { throw null; } + } public partial class ContainerServiceOrchestratorProfile { public ContainerServiceOrchestratorProfile(Azure.ResourceManager.Compute.Models.ContainerServiceOrchestratorTypes orchestratorType) { } @@ -2383,24 +2401,6 @@ public EncryptionSettingsElement() { } public static bool operator !=(Azure.ResourceManager.Compute.Models.EncryptionType left, Azure.ResourceManager.Compute.Models.EncryptionType right) { throw null; } public override string ToString() { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct Enum31 : System.IEquatable - { - private readonly int _dummyPrimitive; - public Enum31(int value) { throw null; } - public static Azure.ResourceManager.Compute.Models.Enum31 Five { get { throw null; } } - public static Azure.ResourceManager.Compute.Models.Enum31 One { get { throw null; } } - public static Azure.ResourceManager.Compute.Models.Enum31 Three { get { throw null; } } - public bool Equals(Azure.ResourceManager.Compute.Models.Enum31 other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.Compute.Models.Enum31 left, Azure.ResourceManager.Compute.Models.Enum31 right) { throw null; } - public static implicit operator Azure.ResourceManager.Compute.Models.Enum31 (int value) { throw null; } - public static bool operator !=(Azure.ResourceManager.Compute.Models.Enum31 left, Azure.ResourceManager.Compute.Models.Enum31 right) { throw null; } - public override string ToString() { throw null; } - } public partial class Gallery : Azure.ResourceManager.Compute.Models.Resource { public Gallery(string location) : base (default(string)) { } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ContainerServiceMasterProfile.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ContainerServiceMasterProfile.Serialization.cs index 425b939f73fc..57eb994745ff 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ContainerServiceMasterProfile.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ContainerServiceMasterProfile.Serialization.cs @@ -27,7 +27,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static ContainerServiceMasterProfile DeserializeContainerServiceMasterProfile(JsonElement element) { - Optional count = default; + Optional count = default; string dnsPrefix = default; Optional fqdn = default; foreach (var property in element.EnumerateObject()) @@ -39,7 +39,7 @@ internal static ContainerServiceMasterProfile DeserializeContainerServiceMasterP property.ThrowNonNullablePropertyIsNull(); continue; } - count = new Enum31(property.Value.GetInt32()); + count = new ContainerServiceMasterProfileCount(property.Value.GetInt32()); continue; } if (property.NameEquals("dnsPrefix")) diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ContainerServiceMasterProfile.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ContainerServiceMasterProfile.cs index 4b26c832b052..9600496be378 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ContainerServiceMasterProfile.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ContainerServiceMasterProfile.cs @@ -29,7 +29,7 @@ public ContainerServiceMasterProfile(string dnsPrefix) /// Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. /// DNS prefix to be used to create the FQDN for master. /// FQDN for the master. - internal ContainerServiceMasterProfile(Enum31? count, string dnsPrefix, string fqdn) + internal ContainerServiceMasterProfile(ContainerServiceMasterProfileCount? count, string dnsPrefix, string fqdn) { Count = count; DnsPrefix = dnsPrefix; @@ -37,7 +37,7 @@ internal ContainerServiceMasterProfile(Enum31? count, string dnsPrefix, string f } /// Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. - public Enum31? Count { get; set; } + public ContainerServiceMasterProfileCount? Count { get; set; } /// DNS prefix to be used to create the FQDN for master. public string DnsPrefix { get; set; } /// FQDN for the master. diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ContainerServiceMasterProfileCount.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ContainerServiceMasterProfileCount.cs new file mode 100644 index 000000000000..f62e2898820f --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ContainerServiceMasterProfileCount.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; +using System.Globalization; + +namespace Azure.ResourceManager.Compute.Models +{ + /// Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. + public readonly partial struct ContainerServiceMasterProfileCount : IEquatable + { + private readonly int _value; + + /// Determines if two values are the same. + public ContainerServiceMasterProfileCount(int value) + { + _value = value; + } + + private const int OneValue = 1; + private const int ThreeValue = 3; + private const int FiveValue = 5; + + /// 1. + public static ContainerServiceMasterProfileCount One { get; } = new ContainerServiceMasterProfileCount(OneValue); + /// 3. + public static ContainerServiceMasterProfileCount Three { get; } = new ContainerServiceMasterProfileCount(ThreeValue); + /// 5. + public static ContainerServiceMasterProfileCount Five { get; } = new ContainerServiceMasterProfileCount(FiveValue); + /// Determines if two values are the same. + public static bool operator ==(ContainerServiceMasterProfileCount left, ContainerServiceMasterProfileCount right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ContainerServiceMasterProfileCount left, ContainerServiceMasterProfileCount right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ContainerServiceMasterProfileCount(int value) => new ContainerServiceMasterProfileCount(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ContainerServiceMasterProfileCount other && Equals(other); + /// + public bool Equals(ContainerServiceMasterProfileCount other) => Equals(_value, other._value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value.GetHashCode(); + /// + public override string ToString() => _value.ToString(CultureInfo.InvariantCulture); + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/Enum31.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/Enum31.cs deleted file mode 100644 index b7625654a58a..000000000000 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/Enum31.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; -using System.Globalization; - -namespace Azure.ResourceManager.Compute.Models -{ - /// Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. - public readonly partial struct Enum31 : IEquatable - { - private readonly int _value; - - /// Determines if two values are the same. - public Enum31(int value) - { - _value = value; - } - - private const int OneValue = 1; - private const int ThreeValue = 3; - private const int FiveValue = 5; - - /// 1. - public static Enum31 One { get; } = new Enum31(OneValue); - /// 3. - public static Enum31 Three { get; } = new Enum31(ThreeValue); - /// 5. - public static Enum31 Five { get; } = new Enum31(FiveValue); - /// Determines if two values are the same. - public static bool operator ==(Enum31 left, Enum31 right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(Enum31 left, Enum31 right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator Enum31(int value) => new Enum31(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is Enum31 other && Equals(other); - /// - public bool Equals(Enum31 other) => Equals(_value, other._value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value.GetHashCode(); - /// - public override string ToString() => _value.ToString(CultureInfo.InvariantCulture); - } -} diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs index a1ec61eca572..22e66270c727 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Authentication/ContainerRegistryChallengeAuthenticationPolicy.cs @@ -31,7 +31,7 @@ namespace Azure.Containers.ContainerRegistry /// Step 5: GET /api/v1/acr/repositories /// Request Header: { Bearer acrTokenAccess } /// - internal class ContainerRegistryChallengeAuthenticationPolicy : BearerTokenChallengeAuthenticationPolicy + internal class ContainerRegistryChallengeAuthenticationPolicy : BearerTokenAuthenticationPolicy { private readonly IContainerRegistryAuthenticationClient _authenticationClient; @@ -44,7 +44,13 @@ public ContainerRegistryChallengeAuthenticationPolicy(TokenCredential credential _authenticationClient = authenticationClient; } - protected override async ValueTask AuthorizeRequestOnChallengeAsync(HttpMessage message, bool async) + protected override ValueTask AuthorizeRequestOnChallengeAsync(HttpMessage message) + => AuthorizeRequestOnChallengeAsyncInternal(message, true); + + protected override bool AuthorizeRequestOnChallenge(HttpMessage message) + => AuthorizeRequestOnChallengeAsyncInternal(message, false).EnsureCompleted(); + + private async ValueTask AuthorizeRequestOnChallengeAsyncInternal(HttpMessage message, bool async) { // Once we're here, we've completed Step 1. diff --git a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj index 5e5ea235e913..77c4832c37e0 100644 --- a/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj +++ b/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/Azure.Containers.ContainerRegistry.csproj @@ -17,7 +17,6 @@ - @@ -28,6 +27,12 @@ + + + + + + diff --git a/sdk/core/Azure.Core/CHANGELOG.md b/sdk/core/Azure.Core/CHANGELOG.md index ad5b5cb3dacc..5a5b26873713 100644 --- a/sdk/core/Azure.Core/CHANGELOG.md +++ b/sdk/core/Azure.Core/CHANGELOG.md @@ -2,6 +2,9 @@ ## 1.14.0-beta.1 (Unreleased) +### Added + +- Added additional methods to `BearerTokenAuthenticationPolicy`, which enables creation of authentication policies that can handle challenges. ## 1.13.0 (2021-04-07) diff --git a/sdk/core/Azure.Core/api/Azure.Core.net461.cs b/sdk/core/Azure.Core/api/Azure.Core.net461.cs index ae3645499e4b..b9e5a690210d 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net461.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net461.cs @@ -514,6 +514,12 @@ public partial class BearerTokenAuthenticationPolicy : Azure.Core.Pipeline.HttpP { public BearerTokenAuthenticationPolicy(Azure.Core.TokenCredential credential, System.Collections.Generic.IEnumerable scopes) { } public BearerTokenAuthenticationPolicy(Azure.Core.TokenCredential credential, string scope) { } + protected virtual void AuthorizeRequest(Azure.Core.HttpMessage message) { } + protected void AuthorizeRequest(Azure.Core.HttpMessage message, Azure.Core.TokenRequestContext context) { } + protected virtual System.Threading.Tasks.ValueTask AuthorizeRequestAsync(Azure.Core.HttpMessage message) { throw null; } + protected System.Threading.Tasks.ValueTask AuthorizeRequestAsync(Azure.Core.HttpMessage message, Azure.Core.TokenRequestContext context) { throw null; } + protected virtual bool AuthorizeRequestOnChallenge(Azure.Core.HttpMessage message) { throw null; } + protected virtual System.Threading.Tasks.ValueTask AuthorizeRequestOnChallengeAsync(Azure.Core.HttpMessage message) { throw null; } public override void Process(Azure.Core.HttpMessage message, System.ReadOnlyMemory pipeline) { } public override System.Threading.Tasks.ValueTask ProcessAsync(Azure.Core.HttpMessage message, System.ReadOnlyMemory pipeline) { throw null; } } diff --git a/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs b/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs index 59624d20ccf6..fa6a03c591fc 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net5.0.cs @@ -514,6 +514,12 @@ public partial class BearerTokenAuthenticationPolicy : Azure.Core.Pipeline.HttpP { public BearerTokenAuthenticationPolicy(Azure.Core.TokenCredential credential, System.Collections.Generic.IEnumerable scopes) { } public BearerTokenAuthenticationPolicy(Azure.Core.TokenCredential credential, string scope) { } + protected virtual void AuthorizeRequest(Azure.Core.HttpMessage message) { } + protected void AuthorizeRequest(Azure.Core.HttpMessage message, Azure.Core.TokenRequestContext context) { } + protected virtual System.Threading.Tasks.ValueTask AuthorizeRequestAsync(Azure.Core.HttpMessage message) { throw null; } + protected System.Threading.Tasks.ValueTask AuthorizeRequestAsync(Azure.Core.HttpMessage message, Azure.Core.TokenRequestContext context) { throw null; } + protected virtual bool AuthorizeRequestOnChallenge(Azure.Core.HttpMessage message) { throw null; } + protected virtual System.Threading.Tasks.ValueTask AuthorizeRequestOnChallengeAsync(Azure.Core.HttpMessage message) { throw null; } public override void Process(Azure.Core.HttpMessage message, System.ReadOnlyMemory pipeline) { } public override System.Threading.Tasks.ValueTask ProcessAsync(Azure.Core.HttpMessage message, System.ReadOnlyMemory pipeline) { throw null; } } diff --git a/sdk/core/Azure.Core/api/Azure.Core.netcoreapp2.1.cs b/sdk/core/Azure.Core/api/Azure.Core.netcoreapp2.1.cs index ae3645499e4b..b9e5a690210d 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.netcoreapp2.1.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.netcoreapp2.1.cs @@ -514,6 +514,12 @@ public partial class BearerTokenAuthenticationPolicy : Azure.Core.Pipeline.HttpP { public BearerTokenAuthenticationPolicy(Azure.Core.TokenCredential credential, System.Collections.Generic.IEnumerable scopes) { } public BearerTokenAuthenticationPolicy(Azure.Core.TokenCredential credential, string scope) { } + protected virtual void AuthorizeRequest(Azure.Core.HttpMessage message) { } + protected void AuthorizeRequest(Azure.Core.HttpMessage message, Azure.Core.TokenRequestContext context) { } + protected virtual System.Threading.Tasks.ValueTask AuthorizeRequestAsync(Azure.Core.HttpMessage message) { throw null; } + protected System.Threading.Tasks.ValueTask AuthorizeRequestAsync(Azure.Core.HttpMessage message, Azure.Core.TokenRequestContext context) { throw null; } + protected virtual bool AuthorizeRequestOnChallenge(Azure.Core.HttpMessage message) { throw null; } + protected virtual System.Threading.Tasks.ValueTask AuthorizeRequestOnChallengeAsync(Azure.Core.HttpMessage message) { throw null; } public override void Process(Azure.Core.HttpMessage message, System.ReadOnlyMemory pipeline) { } public override System.Threading.Tasks.ValueTask ProcessAsync(Azure.Core.HttpMessage message, System.ReadOnlyMemory pipeline) { throw null; } } diff --git a/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs b/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs index ae3645499e4b..b9e5a690210d 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs @@ -514,6 +514,12 @@ public partial class BearerTokenAuthenticationPolicy : Azure.Core.Pipeline.HttpP { public BearerTokenAuthenticationPolicy(Azure.Core.TokenCredential credential, System.Collections.Generic.IEnumerable scopes) { } public BearerTokenAuthenticationPolicy(Azure.Core.TokenCredential credential, string scope) { } + protected virtual void AuthorizeRequest(Azure.Core.HttpMessage message) { } + protected void AuthorizeRequest(Azure.Core.HttpMessage message, Azure.Core.TokenRequestContext context) { } + protected virtual System.Threading.Tasks.ValueTask AuthorizeRequestAsync(Azure.Core.HttpMessage message) { throw null; } + protected System.Threading.Tasks.ValueTask AuthorizeRequestAsync(Azure.Core.HttpMessage message, Azure.Core.TokenRequestContext context) { throw null; } + protected virtual bool AuthorizeRequestOnChallenge(Azure.Core.HttpMessage message) { throw null; } + protected virtual System.Threading.Tasks.ValueTask AuthorizeRequestOnChallengeAsync(Azure.Core.HttpMessage message) { throw null; } public override void Process(Azure.Core.HttpMessage message, System.ReadOnlyMemory pipeline) { } public override System.Threading.Tasks.ValueTask ProcessAsync(Azure.Core.HttpMessage message, System.ReadOnlyMemory pipeline) { throw null; } } diff --git a/sdk/core/Azure.Core/src/Pipeline/BearerTokenAuthenticationPolicy.cs b/sdk/core/Azure.Core/src/Pipeline/BearerTokenAuthenticationPolicy.cs index 209c4b3f69b8..f6d2630187e7 100644 --- a/sdk/core/Azure.Core/src/Pipeline/BearerTokenAuthenticationPolicy.cs +++ b/sdk/core/Azure.Core/src/Pipeline/BearerTokenAuthenticationPolicy.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Net; using System.Threading; using System.Threading.Tasks; using Azure.Core.Diagnostics; @@ -15,29 +16,37 @@ namespace Azure.Core.Pipeline /// public class BearerTokenAuthenticationPolicy : HttpPipelinePolicy { + private string[] _scopes; private readonly AccessTokenCache _accessTokenCache; /// /// Creates a new instance of using provided token credential and scope to authenticate for. /// /// The token credential to use for authentication. - /// The scope to authenticate for. + /// The scope to be included in acquired tokens. public BearerTokenAuthenticationPolicy(TokenCredential credential, string scope) : this(credential, new[] { scope }) { } /// /// Creates a new instance of using provided token credential and scopes to authenticate for. /// /// The token credential to use for authentication. - /// Scopes to authenticate for. + /// Scopes to be included in acquired tokens. + /// When or is null. public BearerTokenAuthenticationPolicy(TokenCredential credential, IEnumerable scopes) - : this(credential, scopes, TimeSpan.FromMinutes(5), TimeSpan.FromSeconds(30)) { } - - internal BearerTokenAuthenticationPolicy(TokenCredential credential, IEnumerable scopes, TimeSpan tokenRefreshOffset, TimeSpan tokenRefreshRetryDelay) + : this(credential, scopes, TimeSpan.FromMinutes(5), TimeSpan.FromSeconds(30)) + { } + + internal BearerTokenAuthenticationPolicy( + TokenCredential credential, + IEnumerable scopes, + TimeSpan tokenRefreshOffset, + TimeSpan tokenRefreshRetryDelay) { Argument.AssertNotNull(credential, nameof(credential)); Argument.AssertNotNull(scopes, nameof(scopes)); - _accessTokenCache = new AccessTokenCache(credential, scopes.ToArray(), tokenRefreshOffset, tokenRefreshRetryDelay); + _scopes = scopes.ToArray(); + _accessTokenCache = new AccessTokenCache(credential, tokenRefreshOffset, tokenRefreshRetryDelay, scopes.ToArray()); } /// @@ -52,6 +61,55 @@ public override void Process(HttpMessage message, ReadOnlyMemory + /// Executes before or + /// is called. + /// Implementers of this method are expected to call or + /// if authorization is required for requests not related to handling a challenge response. + /// + /// The this policy would be applied to. + /// The representing the asynchronous operation. + protected virtual ValueTask AuthorizeRequestAsync(HttpMessage message) + { + var context = new TokenRequestContext(_scopes, message.Request.ClientRequestId); + return AuthorizeRequestAsync(message, context); + } + + /// + /// Executes before or + /// is called. + /// Implementers of this method are expected to call or + /// if authorization is required for requests not related to handling a challenge response. + /// + /// The this policy would be applied to. + protected virtual void AuthorizeRequest(HttpMessage message) + { + var context = new TokenRequestContext(_scopes, message.Request.ClientRequestId); + AuthorizeRequest(message, context); + } + + /// + /// Executed in the event a 401 response with a WWW-Authenticate authentication challenge header is received after the initial request. + /// + /// Service client libraries may override this to handle service specific authentication challenges. + /// The to be authenticated. + /// A boolean indicating whether the request was successfully authenticated and should be sent to the transport. + protected virtual ValueTask AuthorizeRequestOnChallengeAsync(HttpMessage message) + { + return default; + } + + /// + /// Executed in the event a 401 response with a WWW-Authenticate authentication challenge header is received after the initial request. + /// + /// Service client libraries may override this to handle service specific authentication challenges. + /// The to be authenticated. + /// A boolean indicating whether the request was successfully authenticated and should be sent to the transport. + protected virtual bool AuthorizeRequestOnChallenge(HttpMessage message) + { + return false; + } + private async ValueTask ProcessAsync(HttpMessage message, ReadOnlyMemory pipeline, bool async) { if (message.Request.Uri.Scheme != Uri.UriSchemeHttps) @@ -59,38 +117,82 @@ private async ValueTask ProcessAsync(HttpMessage message, ReadOnlyMemory + /// Sets the Authorization header on the . + /// + /// The with the to be authorized. + /// The used to authorize the . + protected async ValueTask AuthorizeRequestAsync(HttpMessage message, TokenRequestContext context) + { + string headerValue = await _accessTokenCache.GetHeaderValueAsync(message, context, true).ConfigureAwait(false); + message.Request.Headers.SetValue(HttpHeader.Names.Authorization, headerValue); + } + + /// + /// Sets the Authorization header on the . + /// + /// The with the to be authorized. + /// The used to authorize the . + protected void AuthorizeRequest(HttpMessage message, TokenRequestContext context) + { + string headerValue = _accessTokenCache.GetHeaderValueAsync(message, context, false).EnsureCompleted(); + message.Request.Headers.SetValue(HttpHeader.Names.Authorization, headerValue); } private class AccessTokenCache { private readonly object _syncObj = new object(); private readonly TokenCredential _credential; - private readonly string[] _scopes; private readonly TimeSpan _tokenRefreshOffset; private readonly TimeSpan _tokenRefreshRetryDelay; + private TokenRequestContext? _currentContext; private TaskCompletionSource? _infoTcs; private TaskCompletionSource? _backgroundUpdateTcs; - public AccessTokenCache(TokenCredential credential, string[] scopes, TimeSpan tokenRefreshOffset, TimeSpan tokenRefreshRetryDelay) + + public AccessTokenCache(TokenCredential credential, TimeSpan tokenRefreshOffset, TimeSpan tokenRefreshRetryDelay, string[] initialScopes) { _credential = credential; - _scopes = scopes; _tokenRefreshOffset = tokenRefreshOffset; _tokenRefreshRetryDelay = tokenRefreshRetryDelay; + _currentContext = new TokenRequestContext(initialScopes); } - public async ValueTask GetHeaderValueAsync(HttpMessage message, bool async) + public async ValueTask GetHeaderValueAsync(HttpMessage message, TokenRequestContext context, bool async) { bool getTokenFromCredential; TaskCompletionSource headerValueTcs; @@ -99,30 +201,36 @@ public async ValueTask GetHeaderValueAsync(HttpMessage message, bool asy while (true) { - (headerValueTcs, backgroundUpdateTcs, getTokenFromCredential) = GetTaskCompletionSources(); + (headerValueTcs, backgroundUpdateTcs, getTokenFromCredential) = GetTaskCompletionSources(context); + HeaderValueInfo info; if (getTokenFromCredential) { if (backgroundUpdateTcs != null) { -#pragma warning disable AZC0111 // DO NOT use EnsureCompleted in possibly asynchronous scope. - HeaderValueInfo info = headerValueTcs.Task.EnsureCompleted(); -#pragma warning restore AZC0111 // DO NOT use EnsureCompleted in possibly asynchronous scope. - _ = Task.Run(() => GetHeaderValueFromCredentialInBackgroundAsync(backgroundUpdateTcs, info, message, async)); + if (async) + { + info = await headerValueTcs.Task.ConfigureAwait(false); + } + else + { +#pragma warning disable AZC0104 // Use EnsureCompleted() directly on asynchronous method return value. + info = headerValueTcs.Task.EnsureCompleted(); +#pragma warning restore AZC0104 // Use EnsureCompleted() directly on asynchronous method return value. + } + _ = Task.Run(() => GetHeaderValueFromCredentialInBackgroundAsync(backgroundUpdateTcs, info, context, async)); return info.HeaderValue; } try { - HeaderValueInfo info = await GetHeaderValueFromCredentialAsync(message, async, message.CancellationToken).ConfigureAwait(false); + info = await GetHeaderValueFromCredentialAsync(context, async, message.CancellationToken).ConfigureAwait(false); headerValueTcs.SetResult(info); } catch (OperationCanceledException) { headerValueTcs.SetCanceled(); } -#pragma warning disable CA1031 // Catch more specific allowed exception type, or rethrow the exception catch (Exception exception) -#pragma warning restore CA1031 // Catch more specific allowed exception type, or rethrow the exception { headerValueTcs.SetException(exception); // The exception will be thrown on the next lines when we touch the result of @@ -148,12 +256,19 @@ public async ValueTask GetHeaderValueAsync(HttpMessage message, bool asy catch (AggregateException) { } // ignore exception here to rethrow it with EnsureCompleted } } + if (async) + { + info = await headerValueTcs.Task.ConfigureAwait(false); + } + else + { +#pragma warning disable AZC0104 // Use EnsureCompleted() directly on asynchronous method return value. + info = headerValueTcs.Task.EnsureCompleted(); +#pragma warning restore AZC0104 // Use EnsureCompleted() directly on asynchronous method return value. + } -#pragma warning disable AZC0111 // DO NOT use EnsureCompleted in possibly asynchronous scope. - return headerValueTcs.Task.EnsureCompleted().HeaderValue; -#pragma warning restore AZC0111 // DO NOT use EnsureCompleted in possibly asynchronous scope. + return info.HeaderValue; } - catch (TaskCanceledException) when (!message.CancellationToken.IsCancellationRequested) { maxCancellationRetries--; @@ -171,15 +286,18 @@ public async ValueTask GetHeaderValueAsync(HttpMessage message, bool asy } } - private (TaskCompletionSource Tcs, TaskCompletionSource? BackgroundUpdateTcs, bool GetTokenFromCredential) GetTaskCompletionSources() + private (TaskCompletionSource InfoTcs, TaskCompletionSource? BackgroundUpdateTcs, bool GetTokenFromCredential) + GetTaskCompletionSources(TokenRequestContext context) { lock (_syncObj) { // Initial state. GetTaskCompletionSources has been called for the first time - if (_infoTcs == null) + if (_infoTcs == null || RequestRequiresNewToken(context)) { + _currentContext = context; _infoTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - return (_infoTcs, default, true); + _backgroundUpdateTcs = default; + return (_infoTcs, _backgroundUpdateTcs, true); } // Getting new access token is in progress, wait for it @@ -191,7 +309,9 @@ public async ValueTask GetHeaderValueAsync(HttpMessage message, bool asy DateTimeOffset now = DateTimeOffset.UtcNow; // Access token has been successfully acquired in background and it is not expired yet, use it instead of current one - if (_backgroundUpdateTcs != null && _backgroundUpdateTcs.Task.Status == TaskStatus.RanToCompletion && _backgroundUpdateTcs.Task.Result.ExpiresOn > now) + if (_backgroundUpdateTcs != null && + _backgroundUpdateTcs.Task.Status == TaskStatus.RanToCompletion && + _backgroundUpdateTcs.Task.Result.ExpiresOn > now) { _infoTcs = _backgroundUpdateTcs; _backgroundUpdateTcs = default; @@ -216,23 +336,33 @@ public async ValueTask GetHeaderValueAsync(HttpMessage message, bool asy } } - private async ValueTask GetHeaderValueFromCredentialInBackgroundAsync(TaskCompletionSource backgroundUpdateTcs, HeaderValueInfo info, HttpMessage httpMessage, bool async) + // must be called under lock (_syncObj) + private bool RequestRequiresNewToken(TokenRequestContext context) => + _currentContext == null || + (context.Scopes != null && !context.Scopes.AsSpan().SequenceEqual(_currentContext.Value.Scopes.AsSpan())) || + (context.Claims != null && !string.Equals(context.Claims, _currentContext.Value.Claims)); + + private async ValueTask GetHeaderValueFromCredentialInBackgroundAsync( + TaskCompletionSource backgroundUpdateTcs, + HeaderValueInfo info, + TokenRequestContext context, + bool async) { var cts = new CancellationTokenSource(_tokenRefreshRetryDelay); try { - HeaderValueInfo newInfo = await GetHeaderValueFromCredentialAsync(httpMessage, async, cts.Token).ConfigureAwait(false); + HeaderValueInfo newInfo = await GetHeaderValueFromCredentialAsync(context, async, cts.Token).ConfigureAwait(false); backgroundUpdateTcs.SetResult(newInfo); } catch (OperationCanceledException oce) when (cts.IsCancellationRequested) { backgroundUpdateTcs.SetResult(new HeaderValueInfo(info.HeaderValue, info.ExpiresOn, DateTimeOffset.UtcNow)); - AzureCoreEventSource.Singleton.BackgroundRefreshFailed(httpMessage.Request.ClientRequestId, oce.ToString()); + AzureCoreEventSource.Singleton.BackgroundRefreshFailed(context.ParentRequestId ?? string.Empty, oce.ToString()); } catch (Exception e) { backgroundUpdateTcs.SetResult(new HeaderValueInfo(info.HeaderValue, info.ExpiresOn, DateTimeOffset.UtcNow + _tokenRefreshRetryDelay)); - AzureCoreEventSource.Singleton.BackgroundRefreshFailed(httpMessage.Request.ClientRequestId, e.ToString()); + AzureCoreEventSource.Singleton.BackgroundRefreshFailed(context.ParentRequestId ?? string.Empty, e.ToString()); } finally { @@ -240,12 +370,11 @@ private async ValueTask GetHeaderValueFromCredentialInBackgroundAsync(TaskComple } } - private async ValueTask GetHeaderValueFromCredentialAsync(HttpMessage message, bool async, CancellationToken cancellationToken) + private async ValueTask GetHeaderValueFromCredentialAsync(TokenRequestContext context, bool async, CancellationToken cancellationToken) { - var requestContext = new TokenRequestContext(_scopes, message.Request.ClientRequestId); AccessToken token = async - ? await _credential.GetTokenAsync(requestContext, cancellationToken).ConfigureAwait(false) - : _credential.GetToken(requestContext, cancellationToken); + ? await _credential.GetTokenAsync(context, cancellationToken).ConfigureAwait(false) + : _credential.GetToken(context, cancellationToken); return new HeaderValueInfo("Bearer " + token.Token, token.ExpiresOn, token.ExpiresOn - _tokenRefreshOffset); } diff --git a/sdk/core/Azure.Core/src/Shared/ARMChallengeAuthenticationPolicy.cs b/sdk/core/Azure.Core/src/Shared/ARMChallengeAuthenticationPolicy.cs index 3735c2888462..6ae3e1d8ea5c 100644 --- a/sdk/core/Azure.Core/src/Shared/ARMChallengeAuthenticationPolicy.cs +++ b/sdk/core/Azure.Core/src/Shared/ARMChallengeAuthenticationPolicy.cs @@ -4,6 +4,7 @@ using System; using System.Threading.Tasks; using System.Collections.Generic; +using System.Linq; #nullable enable @@ -13,25 +14,47 @@ namespace Azure.Core.Pipeline /// A policy that sends an provided by a as an Authentication header. /// Note: This class is currently in preview and is therefore subject to possible future breaking changes. /// - internal class ARMChallengeAuthenticationPolicy : BearerTokenChallengeAuthenticationPolicy + internal class ARMChallengeAuthenticationPolicy : BearerTokenAuthenticationPolicy { + private readonly string[] _scopes; + /// /// Creates a new instance of using provided token credential and scope to authenticate for. /// /// The token credential to use for authentication. /// The scope to authenticate for. - public ARMChallengeAuthenticationPolicy(TokenCredential credential, string scope) : base(credential, new[] { scope }) { } + public ARMChallengeAuthenticationPolicy(TokenCredential credential, string scope) : base(credential, new[] { scope }) + { + _scopes = new[] { scope }; + } /// /// Creates a new instance of using provided token credential and scopes to authenticate for. /// /// The token credential to use for authentication. /// Scopes to authenticate for. - public ARMChallengeAuthenticationPolicy(TokenCredential credential, IEnumerable scopes) - : base(credential, scopes, TimeSpan.FromMinutes(5), TimeSpan.FromSeconds(30)) { } + public ARMChallengeAuthenticationPolicy(TokenCredential credential, IEnumerable scopes) : base(credential, scopes) + { + _scopes = scopes.ToArray(); + } + + /// + protected override async ValueTask AuthorizeRequestOnChallengeAsync(HttpMessage message) + { + var challenge = AuthorizationChallengeParser.GetChallengeParameterFromResponse(message.Response, "Bearer", "claims"); + if (challenge == null) + { + return false; + } + + string claimsChallenge = Base64Url.DecodeString(challenge); + var context = new TokenRequestContext(_scopes, message.Request.ClientRequestId, claimsChallenge); + await AuthorizeRequestAsync(message, context); + return true; + } /// - protected override async ValueTask AuthorizeRequestOnChallengeAsync(HttpMessage message, bool async) + protected override bool AuthorizeRequestOnChallenge(HttpMessage message) { var challenge = AuthorizationChallengeParser.GetChallengeParameterFromResponse(message.Response, "Bearer", "claims"); if (challenge == null) @@ -39,9 +62,9 @@ protected override async ValueTask AuthorizeRequestOnChallengeAsync(HttpMe return false; } - string claimsChallenge = Base64Url.DecodeString(challenge.ToString()); - var context = new TokenRequestContext(Scopes, message.Request.ClientRequestId, claimsChallenge); - await SetAuthorizationHeader(message, context, async); + string claimsChallenge = Base64Url.DecodeString(challenge); + var context = new TokenRequestContext(_scopes, message.Request.ClientRequestId, claimsChallenge); + AuthorizeRequest(message, context); return true; } } diff --git a/sdk/core/Azure.Core/src/Shared/BearerTokenChallengeAuthenticationPolicy.cs b/sdk/core/Azure.Core/src/Shared/BearerTokenChallengeAuthenticationPolicy.cs deleted file mode 100644 index 921f9aef4307..000000000000 --- a/sdk/core/Azure.Core/src/Shared/BearerTokenChallengeAuthenticationPolicy.cs +++ /dev/null @@ -1,362 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Threading; -using System.Threading.Tasks; - -#nullable enable - -namespace Azure.Core.Pipeline -{ - /// - /// A policy that sends an provided by a as an Authentication header. - /// Note: This class is currently in preview and is therefore subject to possible future breaking changes. - /// - internal class BearerTokenChallengeAuthenticationPolicy : HttpPipelinePolicy - { - private readonly AccessTokenCache _accessTokenCache; - protected string[] Scopes { get; private set; } - private readonly ValueTask _falseValueTask = new ValueTask(Task.FromResult(false)); - - /// - /// Creates a new instance of using provided token credential and scope to authenticate for. - /// - /// The token credential to use for authentication. - /// The scope to authenticate for. - public BearerTokenChallengeAuthenticationPolicy(TokenCredential credential, string scope) : this(credential, new[] { scope }) { } - - /// - /// Creates a new instance of using provided token credential and scopes to authenticate for. - /// - /// The token credential to use for authentication. - /// Scopes to authenticate for. - public BearerTokenChallengeAuthenticationPolicy(TokenCredential credential, IEnumerable scopes) - : this(credential, scopes, TimeSpan.FromMinutes(5), TimeSpan.FromSeconds(30)) { } - - internal BearerTokenChallengeAuthenticationPolicy(TokenCredential credential, IEnumerable scopes, TimeSpan tokenRefreshOffset, TimeSpan tokenRefreshRetryDelay) - { - Argument.AssertNotNull(credential, nameof(credential)); - Argument.AssertNotNull(scopes, nameof(scopes)); - - Scopes = scopes.ToArray(); - _accessTokenCache = new AccessTokenCache(credential, tokenRefreshOffset, tokenRefreshRetryDelay, scopes.ToArray()); - } - - /// - public override ValueTask ProcessAsync(HttpMessage message, ReadOnlyMemory pipeline) - { - return ProcessAsync(message, pipeline, true); - } - - /// - public override void Process(HttpMessage message, ReadOnlyMemory pipeline) - { - ProcessAsync(message, pipeline, false).EnsureCompleted(); - } - - /// - /// Executes before or is called. - /// Implementers of this method are expected to call if authorization is required for requests not related to handling a challenge response. - /// - /// The this policy would be applied to. - /// Indicates whether the method was called from an asynchronous context. - /// The representing the asynchronous operation. - protected virtual Task AuthorizeRequestAsync(HttpMessage message, bool async) - { - var context = new TokenRequestContext(Scopes, message.Request.ClientRequestId); - return SetAuthorizationHeader(message, context, async); - } - - /// - /// Executed in the event a 401 response with a WWW-Authenticate authentication challenge header is received after the initial request. - /// - /// Service client libraries may override this to handle service specific authentication challenges. - /// The to be authenticated. - /// Indicates whether the method was called from an asynchronous context. - /// A boolean indicating whether the request was successfully authenticated and should be sent to the transport. - protected virtual ValueTask AuthorizeRequestOnChallengeAsync(HttpMessage message, bool async) - { - return _falseValueTask; - } - - private async ValueTask ProcessAsync(HttpMessage message, ReadOnlyMemory pipeline, bool async) - { - if (message.Request.Uri.Scheme != Uri.UriSchemeHttps) - { - throw new InvalidOperationException("Bearer token authentication is not permitted for non TLS protected (https) endpoints."); - } - - if (async) - { - await AuthorizeRequestAsync(message, true).ConfigureAwait(false); - await ProcessNextAsync(message, pipeline).ConfigureAwait(false); - } - else - { - AuthorizeRequestAsync(message, false).EnsureCompleted(); - ProcessNext(message, pipeline); - } - - // Check if we have received a challenge or we have not yet issued the first request. - if (message.Response.Status == (int)HttpStatusCode.Unauthorized && message.Response.Headers.Contains(HttpHeader.Names.WwwAuthenticate)) - { - // Attempt to get the TokenRequestContext based on the challenge. - // If we fail to get the context, the challenge was not present or invalid. - // If we succeed in getting the context, authenticate the request and pass it up the policy chain. - if (await AuthorizeRequestOnChallengeAsync(message, async).ConfigureAwait(false)) - { - if (async) - { - await ProcessNextAsync(message, pipeline).ConfigureAwait(false); - } - else - { - ProcessNext(message, pipeline); - } - } - } - } - - /// - /// Sets the Authorization header on the . - /// - /// The with the to be authorized. - /// The used to authorize the . - /// Indicates whether the method was called from an asynchronous context. - protected async Task SetAuthorizationHeader(HttpMessage message, TokenRequestContext context, bool async) - { - string headerValue; - if (async) - { - headerValue = await _accessTokenCache.GetHeaderValueAsync(message, context, async).ConfigureAwait(false); - } - else - { - headerValue = _accessTokenCache.GetHeaderValueAsync(message, context, async).EnsureCompleted(); - } - - message.Request.Headers.SetValue(HttpHeader.Names.Authorization, headerValue); - } - - private class AccessTokenCache - { - private readonly object _syncObj = new object(); - private readonly TokenCredential _credential; - private readonly TimeSpan _tokenRefreshOffset; - private readonly TimeSpan _tokenRefreshRetryDelay; - - private TokenRequestContext? _currentContext; - private TaskCompletionSource? _infoTcs; - private TaskCompletionSource? _backgroundUpdateTcs; - public AccessTokenCache(TokenCredential credential, TimeSpan tokenRefreshOffset, TimeSpan tokenRefreshRetryDelay, string[] initialScopes) - { - _credential = credential; - _tokenRefreshOffset = tokenRefreshOffset; - _tokenRefreshRetryDelay = tokenRefreshRetryDelay; - _currentContext = new TokenRequestContext(initialScopes); - } - - public async ValueTask GetHeaderValueAsync(HttpMessage message, TokenRequestContext context, bool async) - { - bool getTokenFromCredential; - TaskCompletionSource headerValueTcs; - TaskCompletionSource? backgroundUpdateTcs; - int maxCancellationRetries = 3; - - while (true) - { - (headerValueTcs, backgroundUpdateTcs, getTokenFromCredential) = GetTaskCompletionSources(context); - HeaderValueInfo info; - if (getTokenFromCredential) - { - if (backgroundUpdateTcs != null) - { - if (async) - { - info = await headerValueTcs.Task.ConfigureAwait(false); - } - else - { -#pragma warning disable AZC0104 // Use EnsureCompleted() directly on asynchronous method return value. - info = headerValueTcs.Task.EnsureCompleted(); -#pragma warning restore AZC0104 // Use EnsureCompleted() directly on asynchronous method return value. - } - _ = Task.Run(() => GetHeaderValueFromCredentialInBackgroundAsync(backgroundUpdateTcs, info, context, async)); - return info.HeaderValue; - } - - try - { - info = await GetHeaderValueFromCredentialAsync(context, async, message.CancellationToken).ConfigureAwait(false); - headerValueTcs.SetResult(info); - } - catch (OperationCanceledException) - { - headerValueTcs.SetCanceled(); - } - catch (Exception exception) - { - headerValueTcs.SetException(exception); - // The exception will be thrown on the next lines when we touch the result of - // headerValueTcs.Task, this approach will prevent later runtime UnobservedTaskException - } - } - - var headerValueTask = headerValueTcs.Task; - try - { - if (!headerValueTask.IsCompleted) - { - if (async) - { - await headerValueTask.AwaitWithCancellation(message.CancellationToken); - } - else - { - try - { - headerValueTask.Wait(message.CancellationToken); - } - catch (AggregateException) { } // ignore exception here to rethrow it with EnsureCompleted - } - } - if (async) - { - info = await headerValueTcs.Task.ConfigureAwait(false); - } - else - { -#pragma warning disable AZC0104 // Use EnsureCompleted() directly on asynchronous method return value. - info = headerValueTcs.Task.EnsureCompleted(); -#pragma warning restore AZC0104 // Use EnsureCompleted() directly on asynchronous method return value. - } - - return info.HeaderValue; - } - catch (TaskCanceledException) when (!message.CancellationToken.IsCancellationRequested) - { - maxCancellationRetries--; - - // If the current message has no CancellationToken and we have tried this 3 times, throw. - if (!message.CancellationToken.CanBeCanceled && maxCancellationRetries <= 0) - { - throw; - } - - // We were waiting on a previous headerValueTcs operation which was canceled. - //Retry the call to GetTaskCompletionSources. - continue; - } - } - } - - private (TaskCompletionSource InfoTcs, TaskCompletionSource? BackgroundUpdateTcs, bool GetTokenFromCredential) GetTaskCompletionSources(TokenRequestContext context) - { - lock (_syncObj) - { - // Initial state. GetTaskCompletionSources has been called for the first time - if (_infoTcs == null || RequestRequiresNewToken(context)) - { - _currentContext = context; - _infoTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - _backgroundUpdateTcs = default; - return (_infoTcs, _backgroundUpdateTcs, true); - } - - // Getting new access token is in progress, wait for it - if (!_infoTcs.Task.IsCompleted) - { - _backgroundUpdateTcs = default; - return (_infoTcs, _backgroundUpdateTcs, false); - } - - DateTimeOffset now = DateTimeOffset.UtcNow; - // Access token has been successfully acquired in background and it is not expired yet, use it instead of current one - if (_backgroundUpdateTcs != null && _backgroundUpdateTcs.Task.Status == TaskStatus.RanToCompletion && _backgroundUpdateTcs.Task.Result.ExpiresOn > now) - { - _infoTcs = _backgroundUpdateTcs; - _backgroundUpdateTcs = default; - } - - // Attempt to get access token has failed or it has already expired. Need to get a new one - if (_infoTcs.Task.Status != TaskStatus.RanToCompletion || now >= _infoTcs.Task.Result.ExpiresOn) - { - _infoTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - return (_infoTcs, default, true); - } - - // Access token is still valid but is about to expire, try to get it in background - if (now >= _infoTcs.Task.Result.RefreshOn && _backgroundUpdateTcs == null) - { - _backgroundUpdateTcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - return (_infoTcs, _backgroundUpdateTcs, true); - } - - // Access token is valid, use it - return (_infoTcs, default, false); - } - } - - // must be called under lock (_syncObj) - private bool RequestRequiresNewToken(TokenRequestContext context) => - _currentContext == null || - (context.Scopes != null && !context.Scopes.AsSpan().SequenceEqual(_currentContext.Value.Scopes.AsSpan())) || - (context.Claims != null && !string.Equals(context.Claims, _currentContext.Value.Claims)); - - private async ValueTask GetHeaderValueFromCredentialInBackgroundAsync(TaskCompletionSource backgroundUpdateTcs, HeaderValueInfo info, TokenRequestContext context, bool async) - { - var cts = new CancellationTokenSource(_tokenRefreshRetryDelay); - try - { - HeaderValueInfo newInfo = await GetHeaderValueFromCredentialAsync(context, async, cts.Token).ConfigureAwait(false); - backgroundUpdateTcs.SetResult(newInfo); - } - catch (OperationCanceledException) when (cts.IsCancellationRequested) - { - backgroundUpdateTcs.SetResult(new HeaderValueInfo(info.HeaderValue, info.ExpiresOn, DateTimeOffset.UtcNow)); - - // https://github.com/Azure/azure-sdk-for-net/issues/18539 - //AzureCoreEventSource.Singleton.BackgroundRefreshFailed(context.ParentRequestId ?? string.Empty, oce.ToString()); - } - catch (Exception) - { - backgroundUpdateTcs.SetResult(new HeaderValueInfo(info.HeaderValue, info.ExpiresOn, DateTimeOffset.UtcNow + _tokenRefreshRetryDelay)); - - // https://github.com/Azure/azure-sdk-for-net/issues/18539 - //AzureCoreEventSource.Singleton.BackgroundRefreshFailed(context.ParentRequestId ?? string.Empty, e.ToString()); - } - finally - { - cts.Dispose(); - } - } - - private async ValueTask GetHeaderValueFromCredentialAsync(TokenRequestContext context, bool async, CancellationToken cancellationToken) - { - AccessToken token = async - ? await _credential.GetTokenAsync(context, cancellationToken).ConfigureAwait(false) - : _credential.GetToken(context, cancellationToken); - - return new HeaderValueInfo("Bearer " + token.Token, token.ExpiresOn, token.ExpiresOn - _tokenRefreshOffset); - } - - private readonly struct HeaderValueInfo - { - public string HeaderValue { get; } - public DateTimeOffset ExpiresOn { get; } - public DateTimeOffset RefreshOn { get; } - - public HeaderValueInfo(string headerValue, DateTimeOffset expiresOn, DateTimeOffset refreshOn) - { - HeaderValue = headerValue; - ExpiresOn = expiresOn; - RefreshOn = refreshOn; - } - } - } - } -} diff --git a/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj b/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj index ef9975b67d5e..ac3aaf34aa81 100644 --- a/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj +++ b/sdk/core/Azure.Core/tests/Azure.Core.Tests.csproj @@ -26,7 +26,6 @@ - diff --git a/sdk/core/Azure.Core/tests/BearerTokenAuthenticationPolicyTests.cs b/sdk/core/Azure.Core/tests/BearerTokenAuthenticationPolicyTests.cs index e648fe10740f..62d1f72b1480 100644 --- a/sdk/core/Azure.Core/tests/BearerTokenAuthenticationPolicyTests.cs +++ b/sdk/core/Azure.Core/tests/BearerTokenAuthenticationPolicyTests.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using Azure.Core.Diagnostics; using Azure.Core.Pipeline; using Azure.Core.TestFramework; using NUnit.Framework; @@ -20,7 +21,8 @@ public BearerTokenAuthenticationPolicyTests(bool isAsync) : base(isAsync) { } public async Task BearerTokenAuthenticationPolicy_UsesTokenProvidedByCredentials() { var credential = new TokenCredentialStub( - (r, c) => r.Scopes.SequenceEqual(new[] { "scope1", "scope2" }) ? new AccessToken("token", DateTimeOffset.MaxValue) : default, IsAsync); + (r, c) => r.Scopes.SequenceEqual(new[] { "scope1", "scope2" }) ? new AccessToken("token", DateTimeOffset.MaxValue) : default, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, new[] { "scope1", "scope2" }); MockTransport transport = CreateMockTransport(new MockResponse(200)); @@ -38,7 +40,8 @@ public async Task BearerTokenAuthenticationPolicy_RequestsTokenEveryRequest() accessTokens.Enqueue(new AccessToken("token2", DateTimeOffset.UtcNow)); var credential = new TokenCredentialStub( - (r, c) => r.Scopes.SequenceEqual(new[] { "scope1", "scope2" }) ? accessTokens.Dequeue() : default, IsAsync); + (r, c) => r.Scopes.SequenceEqual(new[] { "scope1", "scope2" }) ? accessTokens.Dequeue() : default, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, new[] { "scope1", "scope2" }); MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200)); @@ -57,7 +60,8 @@ public async Task BearerTokenAuthenticationPolicy_RequestsTokenEveryRequest() public async Task BearerTokenAuthenticationPolicy_CachesHeaderValue() { var credential = new TokenCredentialStub( - (r, c) => r.Scopes.SequenceEqual(new[] { "scope" }) ? new AccessToken("token", DateTimeOffset.MaxValue) : default, IsAsync); + (r, c) => r.Scopes.SequenceEqual(new[] { "scope" }) ? new AccessToken("token", DateTimeOffset.MaxValue) : default, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, "scope"); MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200)); @@ -76,7 +80,8 @@ public async Task BearerTokenAuthenticationPolicy_CachesHeaderValue() public void BearerTokenAuthenticationPolicy_ThrowsForNonTlsEndpoint() { var credential = new TokenCredentialStub( - (r, c) => r.Scopes.SequenceEqual(new[] { "scope" }) ? new AccessToken("token", DateTimeOffset.MaxValue) : default, IsAsync); + (r, c) => r.Scopes.SequenceEqual(new[] { "scope" }) ? new AccessToken("token", DateTimeOffset.MaxValue) : default, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, "scope"); MockTransport transport = CreateMockTransport(); @@ -99,10 +104,11 @@ public void BearerTokenAuthenticationPolicy_ThrowsForEmptyToken() public async Task BearerTokenAuthenticationPolicy_OneHundredConcurrentCalls() { var credential = new TokenCredentialStub((r, c) => - { - Thread.Sleep(100); - return new AccessToken(Guid.NewGuid().ToString(), DateTimeOffset.UtcNow.AddMinutes(30)); - }, IsAsync); + { + Thread.Sleep(100); + return new AccessToken(Guid.NewGuid().ToString(), DateTimeOffset.UtcNow.AddMinutes(30)); + }, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, "scope"); MockTransport transport = CreateMockTransport(r => new MockResponse(200)); @@ -129,11 +135,12 @@ public async Task BearerTokenAuthenticationPolicy_GatedConcurrentCalls() var requestMre = new ManualResetEventSlim(false); var responseMre = new ManualResetEventSlim(false); var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - return new AccessToken(Guid.NewGuid().ToString(), DateTimeOffset.UtcNow.AddMinutes(30)); - }, IsAsync); + { + requestMre.Set(); + responseMre.Wait(c); + return new AccessToken(Guid.NewGuid().ToString(), DateTimeOffset.UtcNow.AddMinutes(30)); + }, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, "scope"); MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200)); @@ -158,15 +165,16 @@ public async Task BearerTokenAuthenticationPolicy_SucceededFailedSucceeded() var requestMre = new ManualResetEventSlim(false); var callCount = 0; var credential = new TokenCredentialStub((r, c) => - { - Interlocked.Increment(ref callCount); - var offsetTime = DateTimeOffset.UtcNow; - requestMre.Set(); + { + Interlocked.Increment(ref callCount); + var offsetTime = DateTimeOffset.UtcNow; + requestMre.Set(); - return callCount == 2 - ? throw new InvalidOperationException("Call Failed") - : new AccessToken(Guid.NewGuid().ToString(), offsetTime.AddMilliseconds(1000)); - }, IsAsync); + return callCount == 2 + ? throw new InvalidOperationException("Call Failed") + : new AccessToken(Guid.NewGuid().ToString(), offsetTime.AddMilliseconds(1000)); + }, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, new[] { "scope" }, TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(30)); MockTransport transport = CreateMockTransport(r => new MockResponse(200)); @@ -218,14 +226,15 @@ public async Task BearerTokenAuthenticationPolicy_TokenAlmostExpired() var expires = new Queue(new[] { currentTime.AddMinutes(2), currentTime.AddMinutes(30) }); var callCount = 0; var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - requestMre.Reset(); - callCount++; + { + requestMre.Set(); + responseMre.Wait(c); + requestMre.Reset(); + callCount++; - return new AccessToken(Guid.NewGuid().ToString(), expires.Dequeue()); - }, IsAsync); + return new AccessToken(Guid.NewGuid().ToString(), expires.Dequeue()); + }, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, "scope"); MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200), new MockResponse(200), new MockResponse(200)); @@ -264,13 +273,14 @@ public async Task BearerTokenAuthenticationPolicy_TokenAlmostExpired_NoRefresh() var callCount = 0; var credential = new TokenCredentialStub((r, c) => - { - callCount++; - responseMre.Wait(c); - requestMre.Set(); + { + callCount++; + responseMre.Wait(c); + requestMre.Set(); - return new AccessToken(Guid.NewGuid().ToString(), currentTime.AddMinutes(2)); - }, IsAsync); + return new AccessToken(Guid.NewGuid().ToString(), currentTime.AddMinutes(2)); + }, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, "scope"); MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200), new MockResponse(200), new MockResponse(200)); @@ -307,11 +317,12 @@ public async Task BearerTokenAuthenticationPolicy_TokenExpired() var currentTime = DateTimeOffset.UtcNow; var expires = new Queue(new[] { currentTime.AddSeconds(2), currentTime.AddMinutes(30) }); var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - return new AccessToken(Guid.NewGuid().ToString(), expires.Dequeue()); - }, IsAsync); + { + requestMre.Set(); + responseMre.Wait(c); + return new AccessToken(Guid.NewGuid().ToString(), expires.Dequeue()); + }, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, new[] { "scope" }, TimeSpan.FromSeconds(2), TimeSpan.FromMilliseconds(50)); MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200), new MockResponse(200)); @@ -343,10 +354,11 @@ public async Task BearerTokenAuthenticationPolicy_TokenExpired() public void BearerTokenAuthenticationPolicy_OneHundredConcurrentCallsFailed() { var credential = new TokenCredentialStub((r, c) => - { - Thread.Sleep(100); - throw new InvalidOperationException("Error"); - }, IsAsync); + { + Thread.Sleep(100); + throw new InvalidOperationException("Error"); + }, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, "scope"); MockTransport transport = CreateMockTransport(r => new MockResponse(200)); @@ -371,11 +383,12 @@ public async Task BearerTokenAuthenticationPolicy_GatedConcurrentCallsFailed() var requestMre = new ManualResetEventSlim(false); var responseMre = new ManualResetEventSlim(false); var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - throw new InvalidOperationException("Error"); - }, IsAsync); + { + requestMre.Set(); + responseMre.Wait(c); + throw new InvalidOperationException("Error"); + }, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, "scope"); MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200)); @@ -401,17 +414,18 @@ public async Task BearerTokenAuthenticationPolicy_TokenExpiredThenFailed() var responseMre = new ManualResetEventSlim(true); var fail = false; var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - if (fail) { - throw new InvalidOperationException("Error"); - } - - fail = true; - return new AccessToken(Guid.NewGuid().ToString(), DateTimeOffset.UtcNow.AddSeconds(2)); - }, IsAsync); + requestMre.Set(); + responseMre.Wait(c); + if (fail) + { + throw new InvalidOperationException("Error"); + } + + fail = true; + return new AccessToken(Guid.NewGuid().ToString(), DateTimeOffset.UtcNow.AddSeconds(2)); + }, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, new[] { "scope" }, TimeSpan.FromSeconds(2), TimeSpan.FromMilliseconds(50)); MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200), new MockResponse(200)); @@ -449,16 +463,17 @@ public async Task BearerTokenAuthenticationPolicy_TokenAlmostExpiredThenFailed() var getTokenRequestTimes = new List(); var transportCallCount = 0; var credential = new TokenCredentialStub((r, c) => - { - if (transportCallCount > 0) { - credentialMre.Set(); - getTokenRequestTimes.Add(DateTimeOffset.UtcNow); - throw new InvalidOperationException("Error"); - } + if (transportCallCount > 0) + { + credentialMre.Set(); + getTokenRequestTimes.Add(DateTimeOffset.UtcNow); + throw new InvalidOperationException("Error"); + } - return new AccessToken(Guid.NewGuid().ToString(), DateTimeOffset.UtcNow.AddMinutes(1.5)); - }, IsAsync); + return new AccessToken(Guid.NewGuid().ToString(), DateTimeOffset.UtcNow.AddMinutes(1.5)); + }, + IsAsync); var tokenRefreshRetryDelay = TimeSpan.FromSeconds(2); var policy = new BearerTokenAuthenticationPolicy(credential, new[] { "scope" }, TimeSpan.FromMinutes(2), tokenRefreshRetryDelay); @@ -516,11 +531,12 @@ public void BearerTokenAuthenticationPolicy_GatedConcurrentCallsCancelled() var responseMre = new ManualResetEventSlim(false); var cts = new CancellationTokenSource(); var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - throw new InvalidOperationException("Error"); - }, IsAsync); + { + requestMre.Set(); + responseMre.Wait(c); + throw new InvalidOperationException("Error"); + }, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, "scope"); MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200)); @@ -538,18 +554,19 @@ public void BearerTokenAuthenticationPolicy_GatedConcurrentCallsCancelled() } [Test] - public async Task BearerTokenChallengeAuthenticationPolicy_CancelledFirstRequestDoesNotCancelPendingSecondRequest() + public async Task BearerTokenAuthenticationPolicy_CancelledFirstRequestDoesNotCancelPendingSecondRequest() { var currentTime = DateTime.UtcNow; var requestMre = new ManualResetEventSlim(false); var responseMre = new ManualResetEventSlim(false); var cts = new CancellationTokenSource(); var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - return new AccessToken(Guid.NewGuid().ToString(), currentTime.AddMinutes(2)); - }, IsAsync); + { + requestMre.Set(); + responseMre.Wait(c); + return new AccessToken(Guid.NewGuid().ToString(), currentTime.AddMinutes(2)); + }, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, "scope"); MockTransport transport = CreateMockTransport((req) => @@ -571,7 +588,7 @@ public async Task BearerTokenChallengeAuthenticationPolicy_CancelledFirstRequest } [Test] - public void BearerTokenChallengeAuthenticationPolicy_CancelledFirstRequestAndCancelledSecondRequest() + public void BearerTokenAuthenticationPolicy_CancelledFirstRequestAndCancelledSecondRequest() { var currentTime = DateTime.UtcNow; var requestMre = new ManualResetEventSlim(false); @@ -579,11 +596,12 @@ public void BearerTokenChallengeAuthenticationPolicy_CancelledFirstRequestAndCan var cts1 = new CancellationTokenSource(); var cts2 = new CancellationTokenSource(); var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - return new AccessToken(Guid.NewGuid().ToString(), currentTime.AddMinutes(2)); - }, IsAsync); + { + requestMre.Set(); + responseMre.Wait(c); + return new AccessToken(Guid.NewGuid().ToString(), currentTime.AddMinutes(2)); + }, + IsAsync); var policy = new BearerTokenAuthenticationPolicy(credential, "scope"); MockTransport transport = CreateMockTransport((req) => @@ -645,6 +663,111 @@ void UnobservedTaskExceptionHandler(object sender, UnobservedTaskExceptionEventA } } + [Test] + public async Task BearerTokenAuthenticationPolicy_BackgroundRefreshCancelledAndLogs() + { + var requestMre = new ManualResetEventSlim(true); + var responseMre = new ManualResetEventSlim(true); + var currentTime = DateTimeOffset.UtcNow; + var expires = new Queue(new[] { currentTime.AddMinutes(2), currentTime.AddMinutes(30) }); + var callCount = 0; + var logged = false; + string msg = "fail to refresh"; + var credential = new BearerTokenAuthenticationPolicyTests.TokenCredentialStub((r, c) => + { + if (callCount > 0) + { + Task.Delay(100).GetAwaiter().GetResult(); + throw new OperationCanceledException(msg); + } + requestMre.Set(); + responseMre.Wait(c); + requestMre.Reset(); + callCount++; + + return new AccessToken(Guid.NewGuid().ToString(), expires.Dequeue()); + }, + IsAsync); + + AzureEventSourceListener listener = new((args, text) => + { + if (args.EventName == "BackgroundRefreshFailed" && text.Contains(msg)) + { + logged = true; + } + }, System.Diagnostics.Tracing.EventLevel.Informational); + + var policy = new BearerTokenAuthenticationPolicy(credential, new[] { "scope" }, TimeSpan.FromMinutes(5), TimeSpan.FromMilliseconds(10)); + MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200), new MockResponse(200), new MockResponse(200)); + + await SendGetRequest(transport, policy, uri: new Uri("https://example.com/1/Original")); + responseMre.Reset(); + + Task requestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com/3/Refresh")); + // requestMre.Wait(); + + await SendGetRequest(transport, policy, uri: new Uri("https://example.com/2/AlmostExpired")); + await requestTask; + responseMre.Set(); + await Task.Delay(1_000); + + await SendGetRequest(transport, policy, uri: new Uri("https://example.com/4/AfterRefresh")); + + Assert.IsTrue(logged); + } + + [Test] + public async Task BearerTokenAuthenticationPolicy_BackgroundRefreshFailsAndLogs() + { + var requestMre = new ManualResetEventSlim(true); + var responseMre = new ManualResetEventSlim(true); + var currentTime = DateTimeOffset.UtcNow; + var expires = new Queue(new[] { currentTime.AddMinutes(2), currentTime.AddMinutes(30) }); + var callCount = 0; + var logged = false; + string msg = "fail to refresh"; + var credential = new BearerTokenAuthenticationPolicyTests.TokenCredentialStub((r, c) => + { + if (callCount > 0) + { + throw new Exception(msg); + } + requestMre.Set(); + responseMre.Wait(c); + requestMre.Reset(); + callCount++; + + return new AccessToken(Guid.NewGuid().ToString(), expires.Dequeue()); + }, + IsAsync); + + AzureEventSourceListener listener = new((args, text) => + { + if (args.EventName == "BackgroundRefreshFailed" && text.Contains(msg)) + { + logged = true; + } + }, System.Diagnostics.Tracing.EventLevel.Informational); + + var policy = new BearerTokenAuthenticationPolicy(credential, "scope"); + MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200), new MockResponse(200), new MockResponse(200)); + + await SendGetRequest(transport, policy, uri: new Uri("https://example.com/1/Original")); + responseMre.Reset(); + + Task requestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com/3/Refresh")); + // requestMre.Wait(); + + await SendGetRequest(transport, policy, uri: new Uri("https://example.com/2/AlmostExpired")); + await requestTask; + responseMre.Set(); + await Task.Delay(1_000); + + await SendGetRequest(transport, policy, uri: new Uri("https://example.com/4/AfterRefresh")); + + Assert.IsTrue(logged); + } + private class TokenCredentialStub : TokenCredential { public TokenCredentialStub(Func handler, bool isAsync) diff --git a/sdk/core/Azure.Core/tests/BearerTokenChallengeAuthenticationPolicyTests.cs b/sdk/core/Azure.Core/tests/BearerTokenChallengeAuthenticationPolicyTests.cs deleted file mode 100644 index 3067d1edf08d..000000000000 --- a/sdk/core/Azure.Core/tests/BearerTokenChallengeAuthenticationPolicyTests.cs +++ /dev/null @@ -1,671 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core.Pipeline; -using Azure.Core.TestFramework; -using NUnit.Framework; - -namespace Azure.Core.Tests -{ - public class BearerTokenChallengeAuthenticationPolicyTests : SyncAsyncPolicyTestBase - { - public BearerTokenChallengeAuthenticationPolicyTests(bool isAsync) : base(isAsync) { } - - [Test] - public async Task BearerTokenChallengeAuthenticationPolicy_UsesTokenProvidedByCredentials() - { - var credential = new TokenCredentialStub( - (r, c) => r.Scopes.SequenceEqual(new[] { "scope1", "scope2" }) ? new AccessToken("token", DateTimeOffset.MaxValue) : default, IsAsync); - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, new[] { "scope1", "scope2" }); - - MockTransport transport = CreateMockTransport(new MockResponse(200)); - await SendGetRequest(transport, policy, uri: new Uri("https://example.com")); - - Assert.True(transport.SingleRequest.Headers.TryGetValue("Authorization", out string authValue)); - Assert.AreEqual("Bearer token", authValue); - } - - [Test] - public async Task BearerTokenChallengeAuthenticationPolicy_RequestsTokenEveryRequest() - { - var accessTokens = new Queue(); - accessTokens.Enqueue(new AccessToken("token1", DateTimeOffset.UtcNow)); - accessTokens.Enqueue(new AccessToken("token2", DateTimeOffset.UtcNow)); - - var credential = new TokenCredentialStub( - (r, c) => r.Scopes.SequenceEqual(new[] { "scope1", "scope2" }) ? accessTokens.Dequeue() : default, IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, new[] { "scope1", "scope2" }); - MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200)); - - await SendGetRequest(transport, policy, uri: new Uri("https://example.com")); - await SendGetRequest(transport, policy, uri: new Uri("https://example.com")); - - Assert.True(transport.Requests[0].Headers.TryGetValue("Authorization", out string auth1Value)); - Assert.True(transport.Requests[1].Headers.TryGetValue("Authorization", out string auth2Value)); - - Assert.AreEqual("Bearer token1", auth1Value); - Assert.AreEqual("Bearer token2", auth2Value); - } - - [Test] - public async Task BearerTokenChallengeAuthenticationPolicy_CachesHeaderValue() - { - var credential = new TokenCredentialStub( - (r, c) => r.Scopes.SequenceEqual(new[] { "scope" }) ? new AccessToken("token", DateTimeOffset.MaxValue) : default, IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, "scope"); - MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200)); - - await SendGetRequest(transport, policy, uri: new Uri("https://example.com")); - await SendGetRequest(transport, policy, uri: new Uri("https://example.com")); - - Assert.True(transport.Requests[0].Headers.TryGetValue("Authorization", out string auth1Value)); - Assert.True(transport.Requests[1].Headers.TryGetValue("Authorization", out string auth2Value)); - - Assert.AreSame(auth1Value, auth1Value); - Assert.AreEqual("Bearer token", auth2Value); - } - - [Test] - public void BearerTokenChallengeAuthenticationPolicy_ThrowsForNonTlsEndpoint() - { - var credential = new TokenCredentialStub( - (r, c) => r.Scopes.SequenceEqual(new[] { "scope" }) ? new AccessToken("token", DateTimeOffset.MaxValue) : default, IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, "scope"); - MockTransport transport = CreateMockTransport(); - - Assert.ThrowsAsync(async () => await SendGetRequest(transport, policy, uri: new Uri("http://example.com"))); - } - - [Test] - public void BearerTokenChallengeAuthenticationPolicy_ThrowsForEmptyToken() - { - var credential = new TokenCredentialStub((r, c) => new AccessToken(string.Empty, DateTimeOffset.MaxValue), IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, "scope"); - MockTransport transport = CreateMockTransport(); - - Assert.ThrowsAsync(async () => await SendGetRequest(transport, policy, uri: new Uri("http://example.com"))); - } - - [Test] - public async Task BearerTokenChallengeAuthenticationPolicy_OneHundredConcurrentCalls() - { - var credential = new TokenCredentialStub((r, c) => - { - Thread.Sleep(100); - return new AccessToken(Guid.NewGuid().ToString(), DateTimeOffset.UtcNow.AddMinutes(30)); - }, IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, "scope"); - MockTransport transport = CreateMockTransport(r => new MockResponse(200)); - var requestTasks = new Task[100]; - - for (int i = 0; i < requestTasks.Length; i++) - { - requestTasks[i] = SendGetRequest(transport, policy, uri: new Uri("https://example.com")); - } - - await Task.WhenAll(requestTasks); - Assert.True(transport.Requests[0].Headers.TryGetValue("Authorization", out string auth1Value)); - - for (int i = 1; i < requestTasks.Length; i++) - { - Assert.True(transport.Requests[i].Headers.TryGetValue("Authorization", out string authValue)); - Assert.AreEqual(auth1Value, authValue); - } - } - - [Test] - public async Task BearerTokenChallengeAuthenticationPolicy_GatedConcurrentCalls() - { - var requestMre = new ManualResetEventSlim(false); - var responseMre = new ManualResetEventSlim(false); - var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - return new AccessToken(Guid.NewGuid().ToString(), DateTimeOffset.UtcNow.AddMinutes(30)); - }, IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, "scope"); - MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200)); - - var firstRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com")); - requestMre.Wait(); - - var secondRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com")); - responseMre.Set(); - - await Task.WhenAll(firstRequestTask, secondRequestTask); - - Assert.True(transport.Requests[0].Headers.TryGetValue("Authorization", out string auth1Value)); - Assert.True(transport.Requests[1].Headers.TryGetValue("Authorization", out string auth2Value)); - - Assert.AreEqual(auth1Value, auth2Value); - } - - [Test] - public async Task BearerTokenChallengeAuthenticationPolicy_SucceededFailedSucceeded() - { - var requestMre = new ManualResetEventSlim(false); - var callCount = 0; - var credential = new TokenCredentialStub((r, c) => - { - Interlocked.Increment(ref callCount); - var offsetTime = DateTimeOffset.UtcNow; - requestMre.Set(); - - return callCount == 2 - ? throw new InvalidOperationException("Call Failed") - : new AccessToken(Guid.NewGuid().ToString(), offsetTime.AddMilliseconds(1000)); - }, IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, new[] { "scope" }, TimeSpan.FromMilliseconds(100), TimeSpan.FromSeconds(30)); - MockTransport transport = CreateMockTransport(r => new MockResponse(200)); - - var firstRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com/1")); - var secondRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com/2")); - - requestMre.Wait(); - await Task.Delay(200); - - await Task.WhenAll(firstRequestTask, secondRequestTask); - await Task.Delay(1000); - - Assert.AreEqual(1, callCount); - requestMre.Reset(); - - var failedTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com/3/failed")); - requestMre.Wait(); - - Assert.AreEqual(2, callCount); - Assert.ThrowsAsync(async () => await failedTask); - - requestMre.Reset(); - - firstRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com/4")); - secondRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com/5")); - - requestMre.Wait(); - - await Task.WhenAll(firstRequestTask, secondRequestTask); - - Assert.True(transport.Requests[0].Headers.TryGetValue("Authorization", out string auth1Value)); - Assert.True(transport.Requests[1].Headers.TryGetValue("Authorization", out string auth2Value)); - Assert.True(transport.Requests[2].Headers.TryGetValue("Authorization", out string auth3Value)); - Assert.True(transport.Requests[3].Headers.TryGetValue("Authorization", out string auth4Value)); - - Assert.AreEqual(3, callCount); - Assert.AreEqual(auth1Value, auth2Value); - Assert.AreNotEqual(auth2Value, auth3Value); - Assert.AreEqual(auth3Value, auth4Value); - } - - [Test] - public async Task BearerTokenChallengeAuthenticationPolicy_TokenAlmostExpired() - { - var requestMre = new ManualResetEventSlim(true); - var responseMre = new ManualResetEventSlim(true); - var currentTime = DateTimeOffset.UtcNow; - var expires = new Queue(new[] { currentTime.AddMinutes(2), currentTime.AddMinutes(30) }); - var callCount = 0; - var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - requestMre.Reset(); - callCount++; - - return new AccessToken(Guid.NewGuid().ToString(), expires.Dequeue()); - }, IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, "scope"); - MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200), new MockResponse(200), new MockResponse(200)); - - await SendGetRequest(transport, policy, uri: new Uri("https://example.com/1/Original")); - responseMre.Reset(); - - Task requestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com/3/Refresh")); - requestMre.Wait(); - - await SendGetRequest(transport, policy, uri: new Uri("https://example.com/2/AlmostExpired")); - await requestTask; - responseMre.Set(); - await Task.Delay(1_000); - - await SendGetRequest(transport, policy, uri: new Uri("https://example.com/4/AfterRefresh")); - - Assert.AreEqual(2, callCount); - - Assert.True(transport.Requests[0].Headers.TryGetValue("Authorization", out string auth1Value)); - Assert.True(transport.Requests[1].Headers.TryGetValue("Authorization", out string auth2Value)); - Assert.True(transport.Requests[2].Headers.TryGetValue("Authorization", out string auth3Value)); - Assert.True(transport.Requests[3].Headers.TryGetValue("Authorization", out string auth4Value)); - - Assert.AreEqual(auth1Value, auth2Value); - Assert.AreEqual(auth2Value, auth3Value); - Assert.AreNotEqual(auth3Value, auth4Value); - } - - [Test] - public async Task BearerTokenChallengeAuthenticationPolicy_TokenAlmostExpired_NoRefresh() - { - var requestMre = new ManualResetEventSlim(true); - var responseMre = new ManualResetEventSlim(true); - var currentTime = DateTimeOffset.UtcNow; - var callCount = 0; - - var credential = new TokenCredentialStub((r, c) => - { - callCount++; - responseMre.Wait(c); - requestMre.Set(); - - return new AccessToken(Guid.NewGuid().ToString(), currentTime.AddMinutes(2)); - }, IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, "scope"); - MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200), new MockResponse(200), new MockResponse(200)); - - await SendGetRequest(transport, policy, uri: new Uri("https://example.com/1/Original")); - requestMre.Wait(); - responseMre.Reset(); - - await SendGetRequest(transport, policy, uri: new Uri("https://example.com/2/AlmostExpired")); - await SendGetRequest(transport, policy, uri: new Uri("https://example.com/3/AlmostExpired")); - await SendGetRequest(transport, policy, uri: new Uri("https://example.com/4/AlmostExpired")); - - requestMre.Reset(); - responseMre.Set(); - requestMre.Wait(); - - Assert.AreEqual(2, callCount); - - Assert.True(transport.Requests[0].Headers.TryGetValue("Authorization", out string auth1Value)); - Assert.True(transport.Requests[1].Headers.TryGetValue("Authorization", out string auth2Value)); - Assert.True(transport.Requests[2].Headers.TryGetValue("Authorization", out string auth3Value)); - Assert.True(transport.Requests[3].Headers.TryGetValue("Authorization", out string auth4Value)); - - Assert.AreEqual(auth1Value, auth2Value); - Assert.AreEqual(auth2Value, auth3Value); - Assert.AreEqual(auth3Value, auth4Value); - } - - [Test] - public async Task BearerTokenChallengeAuthenticationPolicy_TokenExpired() - { - var requestMre = new ManualResetEventSlim(true); - var responseMre = new ManualResetEventSlim(true); - var currentTime = DateTimeOffset.UtcNow; - var expires = new Queue(new[] { currentTime.AddSeconds(2), currentTime.AddMinutes(30) }); - var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - return new AccessToken(Guid.NewGuid().ToString(), expires.Dequeue()); - }, IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, new[] { "scope" }, TimeSpan.FromSeconds(2), TimeSpan.FromMilliseconds(50)); - MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200), new MockResponse(200)); - - await SendGetRequest(transport, policy, uri: new Uri("https://example.com/0")); - Assert.True(transport.Requests[0].Headers.TryGetValue("Authorization", out string authValue)); - - await Task.Delay(3_000); - - requestMre.Reset(); - responseMre.Reset(); - - var firstRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com/1")); - var secondRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com/2")); - requestMre.Wait(); - await Task.Delay(1_000); - responseMre.Set(); - - await Task.WhenAll(firstRequestTask, secondRequestTask); - - Assert.True(transport.Requests[1].Headers.TryGetValue("Authorization", out string auth1Value)); - Assert.True(transport.Requests[2].Headers.TryGetValue("Authorization", out string auth2Value)); - - Assert.AreNotEqual(authValue, auth1Value); - Assert.AreEqual(auth1Value, auth2Value); - } - - [Test] - public void BearerTokenChallengeAuthenticationPolicy_OneHundredConcurrentCallsFailed() - { - var credential = new TokenCredentialStub((r, c) => - { - Thread.Sleep(100); - throw new InvalidOperationException("Error"); - }, IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, "scope"); - MockTransport transport = CreateMockTransport(r => new MockResponse(200)); - var requestTasks = new Task[100]; - - for (int i = 0; i < requestTasks.Length; i++) - { - requestTasks[i] = SendGetRequest(transport, policy, uri: new Uri("https://example.com")); - } - - Assert.CatchAsync(async () => await Task.WhenAll(requestTasks)); - - foreach (Task task in requestTasks) - { - Assert.IsTrue(task.IsFaulted); - } - } - - [Test] - public async Task BearerTokenChallengeAuthenticationPolicy_GatedConcurrentCallsFailed() - { - var requestMre = new ManualResetEventSlim(false); - var responseMre = new ManualResetEventSlim(false); - var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - throw new InvalidOperationException("Error"); - }, IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, "scope"); - MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200)); - - var firstRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com")); - var secondRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com")); - - requestMre.Wait(); - await Task.Delay(1_000); - responseMre.Set(); - - Assert.CatchAsync(async () => await Task.WhenAll(firstRequestTask, secondRequestTask)); - - Assert.IsTrue(firstRequestTask.IsFaulted); - Assert.IsTrue(secondRequestTask.IsFaulted); - Assert.AreEqual(firstRequestTask.Exception.InnerException, secondRequestTask.Exception.InnerException); - } - - [Test] - public async Task BearerTokenChallengeAuthenticationPolicy_TokenExpiredThenFailed() - { - var requestMre = new ManualResetEventSlim(true); - var responseMre = new ManualResetEventSlim(true); - var fail = false; - var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - if (fail) - { - throw new InvalidOperationException("Error"); - } - - fail = true; - return new AccessToken(Guid.NewGuid().ToString(), DateTimeOffset.UtcNow.AddSeconds(2)); - }, IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, new[] { "scope" }, TimeSpan.FromSeconds(2), TimeSpan.FromMilliseconds(50)); - MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200), new MockResponse(200)); - - await SendGetRequest(transport, policy, uri: new Uri("https://example.com/0")); - Assert.True(transport.Requests[0].Headers.TryGetValue("Authorization", out string _)); - - await Task.Delay(3_000); - - requestMre.Reset(); - responseMre.Reset(); - - var firstRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com")); - var secondRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com")); - - requestMre.Wait(); - await Task.Delay(1_000); - responseMre.Set(); - - Assert.CatchAsync(async () => await Task.WhenAll(firstRequestTask, secondRequestTask)); - - Assert.IsTrue(firstRequestTask.IsFaulted); - Assert.IsTrue(secondRequestTask.IsFaulted); - Assert.AreEqual(firstRequestTask.Exception.InnerException, secondRequestTask.Exception.InnerException); - } - - [Test] - [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/14612")] - public async Task BearerTokenChallengeAuthenticationPolicy_TokenAlmostExpiredThenFailed() - { - var requestMre = new ManualResetEventSlim(true); - var responseMre = new ManualResetEventSlim(true); - var credentialMre = new ManualResetEventSlim(false); - - var getTokenRequestTimes = new List(); - var transportCallCount = 0; - var credential = new TokenCredentialStub((r, c) => - { - if (transportCallCount > 0) - { - credentialMre.Set(); - getTokenRequestTimes.Add(DateTimeOffset.UtcNow); - throw new InvalidOperationException("Error"); - } - - return new AccessToken(Guid.NewGuid().ToString(), DateTimeOffset.UtcNow.AddMinutes(1.5)); - }, IsAsync); - - var tokenRefreshRetryDelay = TimeSpan.FromSeconds(2); - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, new[] { "scope" }, TimeSpan.FromMinutes(2), tokenRefreshRetryDelay); - MockTransport transport = CreateMockTransport(r => - { - requestMre.Set(); - responseMre.Wait(); - if (Interlocked.Increment(ref transportCallCount) == 4) - { - credentialMre.Wait(); - } - return new MockResponse(200); - }); - - await SendGetRequest(transport, policy, uri: new Uri("https://example.com/1")); - Assert.True(transport.Requests[0].Headers.TryGetValue("Authorization", out string auth1Value)); - - requestMre.Reset(); - responseMre.Reset(); - - Task requestTask1 = SendGetRequest(transport, policy, uri: new Uri("https://example.com/2/TokenFromCache/RefreshInBackground")); - Task requestTask2 = SendGetRequest(transport, policy, uri: new Uri("https://example.com/3/TokenFromCache/")); - - requestMre.Wait(); - responseMre.Set(); - - await Task.WhenAll(requestTask1, requestTask2); - - await SendGetRequest(transport, policy, uri: new Uri("https://example.com/4/TokenFromCache")); - - await Task.Delay((int)tokenRefreshRetryDelay.TotalMilliseconds + 1_000); - credentialMre.Reset(); - - await SendGetRequest(transport, policy, uri: new Uri("https://example.com/5/TokenFromCache/GetTokenFailed")); - credentialMre.Wait(); - - Assert.True(transport.Requests[1].Headers.TryGetValue("Authorization", out string auth2Value)); - Assert.True(transport.Requests[2].Headers.TryGetValue("Authorization", out string auth3Value)); - Assert.True(transport.Requests[3].Headers.TryGetValue("Authorization", out string auth4Value)); - Assert.True(transport.Requests[4].Headers.TryGetValue("Authorization", out string auth5Value)); - - Assert.AreEqual(auth1Value, auth2Value); - Assert.AreEqual(auth2Value, auth3Value); - Assert.AreEqual(auth3Value, auth4Value); - Assert.AreEqual(auth4Value, auth5Value); - - Assert.AreEqual(2, getTokenRequestTimes.Count); - Assert.True(getTokenRequestTimes[1] - getTokenRequestTimes[0] > tokenRefreshRetryDelay); - } - - [Test] - public void BearerTokenChallengeAuthenticationPolicy_GatedConcurrentCallsCancelled() - { - var requestMre = new ManualResetEventSlim(false); - var responseMre = new ManualResetEventSlim(false); - var cts = new CancellationTokenSource(); - var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - throw new InvalidOperationException("Error"); - }, IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, "scope"); - MockTransport transport = CreateMockTransport(new MockResponse(200), new MockResponse(200)); - - var firstRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com"), cancellationToken: default); - requestMre.Wait(); - - var secondRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com"), cancellationToken: cts.Token); - cts.Cancel(); - - Assert.CatchAsync(async () => await secondRequestTask); - responseMre.Set(); - - Assert.CatchAsync(async () => await firstRequestTask); - } - - [Test] - public async Task BearerTokenChallengeAuthenticationPolicy_CancelledFirstRequestDoesNotCancelPendingSecondRequest() - { - var currentTime = DateTime.UtcNow; - var requestMre = new ManualResetEventSlim(false); - var responseMre = new ManualResetEventSlim(false); - var cts = new CancellationTokenSource(); - var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - return new AccessToken(Guid.NewGuid().ToString(), currentTime.AddMinutes(2)); - }, IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, "scope"); - MockTransport transport = CreateMockTransport((req) => new MockResponse(200)); - - var firstRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com"), cancellationToken: cts.Token); - requestMre.Wait(); - - var secondRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com"), cancellationToken: default); - cts.Cancel(); - - Assert.CatchAsync(async () => await firstRequestTask); - responseMre.Set(); - - var response = await secondRequestTask; - Assert.That(response.Status, Is.EqualTo(200)); - } - - [Test] - public void BearerTokenChallengeAuthenticationPolicy_CancelledFirstRequestAndCancelledSecondRequest() - { - var currentTime = DateTime.UtcNow; - var requestMre = new ManualResetEventSlim(false); - var responseMre = new ManualResetEventSlim(false); - var cts1 = new CancellationTokenSource(); - var cts2 = new CancellationTokenSource(); - var credential = new TokenCredentialStub((r, c) => - { - requestMre.Set(); - responseMre.Wait(c); - return new AccessToken(Guid.NewGuid().ToString(), currentTime.AddMinutes(2)); - }, IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, "scope"); - MockTransport transport = CreateMockTransport((req) => - { - return new MockResponse(200); - }); - - var firstRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com"), cancellationToken: cts1.Token); - requestMre.Wait(); - - var secondRequestTask = SendGetRequest(transport, policy, uri: new Uri("https://example.com"), cancellationToken: cts2.Token); - cts1.Cancel(); - cts2.Cancel(); - - Assert.CatchAsync(async () => await firstRequestTask); - responseMre.Set(); - - Assert.CatchAsync(async () => await secondRequestTask); - } - - [Test] - [Repeat(10)] - public void BearerTokenChallengeAuthenticationPolicy_UnobservedTaskException() - { - var unobservedTaskExceptionWasRaised = false; - var expectedFailedException = new RequestFailedException("Communication Error"); - try - { - TaskScheduler.UnobservedTaskException += UnobservedTaskExceptionHandler; - var credential = - new TokenCredentialStub((_, ct) => throw expectedFailedException, - IsAsync); - - var policy = new BearerTokenChallengeAuthenticationPolicy(credential, "scope"); - MockTransport transport = CreateMockTransport((_) => new MockResponse(500)); - - Assert.ThrowsAsync(async () => - await SendRequestAsync(transport, request => { request.Uri.Scheme = "https"; }, policy)); - - GC.Collect(); - GC.WaitForPendingFinalizers(); - GC.Collect(); - } - finally - { - TaskScheduler.UnobservedTaskException -= UnobservedTaskExceptionHandler; - } - - Assert.False(unobservedTaskExceptionWasRaised, "UnobservedTaskException should not be raised"); - - void UnobservedTaskExceptionHandler(object sender, UnobservedTaskExceptionEventArgs args) - { - if (args.Exception.InnerException == null || - args.Exception.InnerException.ToString() != expectedFailedException.ToString()) - return; - - args.SetObserved(); - unobservedTaskExceptionWasRaised = true; - } - } - - private class TokenCredentialStub : TokenCredential - { - public TokenCredentialStub(Func handler, bool isAsync) - { - if (isAsync) - { -#pragma warning disable 1998 - _getTokenAsyncHandler = async (r, c) => handler(r, c); -#pragma warning restore 1998 - } - else - { - _getTokenHandler = handler; - } - } - - private readonly Func> _getTokenAsyncHandler; - private readonly Func _getTokenHandler; - - public override ValueTask GetTokenAsync(TokenRequestContext requestContext, CancellationToken cancellationToken) - => _getTokenAsyncHandler(requestContext, cancellationToken); - - public override AccessToken GetToken(TokenRequestContext requestContext, CancellationToken cancellationToken) - => _getTokenHandler(requestContext, cancellationToken); - } - } -} diff --git a/sdk/identity/Azure.Identity/perf/Azure.Identity.Perf.csproj b/sdk/identity/Azure.Identity/perf/Azure.Identity.Perf.csproj index 734202e9af2f..6a46ef3e3a9e 100644 --- a/sdk/identity/Azure.Identity/perf/Azure.Identity.Perf.csproj +++ b/sdk/identity/Azure.Identity/perf/Azure.Identity.Perf.csproj @@ -12,7 +12,6 @@ - @@ -26,4 +25,11 @@ + + + + + + + diff --git a/sdk/identity/Azure.Identity/perf/BearerTokenChallengeAuthenticationPolicyPerfTest.cs b/sdk/identity/Azure.Identity/perf/BearerTokenChallengeAuthenticationPolicyPerfTest.cs deleted file mode 100644 index 16432ef314e0..000000000000 --- a/sdk/identity/Azure.Identity/perf/BearerTokenChallengeAuthenticationPolicyPerfTest.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.Core.TestFramework; -using Azure.Test.Perf; - -namespace Azure.Identity.Perf -{ - public class BearerTokenChallengeAuthenticationPolicyPerfTest : PerfTest - { - private HttpPipeline _pipeline; - private HttpMessage _message; - - public BearerTokenChallengeAuthenticationPolicyPerfTest(CountOptions options) : base(options) - { - var _transport = new MockTransport((req) => new MockResponse(200)); - _pipeline = new HttpPipeline(_transport, new[] { new BearerTokenChallengeAuthenticationPolicy(new StaticCredential(), "scope") }); - _message = _pipeline.CreateMessage(); - _message.BufferResponse = true; - _message.Request.Method = RequestMethod.Get; - _message.Request.Uri.Reset(new Uri("https://example.com")); - } - - public override void Run(CancellationToken cancellationToken) - { - _pipeline.Send(_message, cancellationToken); - } - - public override async Task RunAsync(CancellationToken cancellationToken) - { - await _pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); - } - } -} diff --git a/sdk/iot/Azure.IoT.Hub.Service/api/Azure.Iot.Hub.Service.netstandard2.0.cs b/sdk/iot/Azure.IoT.Hub.Service/api/Azure.Iot.Hub.Service.netstandard2.0.cs index 28fd5d90e949..1adbbf17183e 100644 --- a/sdk/iot/Azure.IoT.Hub.Service/api/Azure.Iot.Hub.Service.netstandard2.0.cs +++ b/sdk/iot/Azure.IoT.Hub.Service/api/Azure.Iot.Hub.Service.netstandard2.0.cs @@ -1,4 +1,4 @@ -namespace Azure.Iot.Hub.Service +namespace Azure.IoT.Hub.Service { public enum BulkIfMatchPrecondition { @@ -12,44 +12,44 @@ public CloudToDeviceMessagesClient() { } public partial class ConfigurationsClient { protected ConfigurationsClient() { } - public virtual Azure.Response CreateOrUpdateConfiguration(Azure.Iot.Hub.Service.Models.TwinConfiguration configuration, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateConfigurationAsync(Azure.Iot.Hub.Service.Models.TwinConfiguration configuration, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response DeleteConfiguration(Azure.Iot.Hub.Service.Models.TwinConfiguration configuration, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteConfigurationAsync(Azure.Iot.Hub.Service.Models.TwinConfiguration configuration, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetConfiguration(string configurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetConfigurationAsync(string configurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response> GetConfigurations(int? count = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task>> GetConfigurationsAsync(int? count = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> TestQueries(Azure.Iot.Hub.Service.Models.ConfigurationQueriesTestInput configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response TestQueriesAsync(Azure.Iot.Hub.Service.Models.ConfigurationQueriesTestInput configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateOrUpdateConfiguration(Azure.IoT.Hub.Service.Models.TwinConfiguration configuration, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateConfigurationAsync(Azure.IoT.Hub.Service.Models.TwinConfiguration configuration, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DeleteConfiguration(Azure.IoT.Hub.Service.Models.TwinConfiguration configuration, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteConfigurationAsync(Azure.IoT.Hub.Service.Models.TwinConfiguration configuration, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetConfiguration(string configurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConfigurationAsync(string configurationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response> GetConfigurations(int? count = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task>> GetConfigurationsAsync(int? count = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> TestQueries(Azure.IoT.Hub.Service.Models.ConfigurationQueriesTestInput configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response TestQueriesAsync(Azure.IoT.Hub.Service.Models.ConfigurationQueriesTestInput configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class DevicesClient { protected DevicesClient() { } - public virtual Azure.Response CreateIdentities(System.Collections.Generic.IEnumerable deviceIdentities, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateIdentitiesAsync(System.Collections.Generic.IEnumerable deviceIdentities, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response CreateIdentitiesWithTwin(System.Collections.Generic.IDictionary devices, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateIdentitiesWithTwinAsync(System.Collections.Generic.IDictionary devices, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response CreateOrUpdateIdentity(Azure.Iot.Hub.Service.Models.DeviceIdentity deviceIdentity, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateIdentityAsync(Azure.Iot.Hub.Service.Models.DeviceIdentity deviceIdentity, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response DeleteIdentities(System.Collections.Generic.IEnumerable deviceIdentities, Azure.Iot.Hub.Service.BulkIfMatchPrecondition precondition = Azure.Iot.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> DeleteIdentitiesAsync(System.Collections.Generic.IEnumerable deviceIdentities, Azure.Iot.Hub.Service.BulkIfMatchPrecondition precondition = Azure.Iot.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response DeleteIdentity(Azure.Iot.Hub.Service.Models.DeviceIdentity deviceIdentity, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteIdentityAsync(Azure.Iot.Hub.Service.Models.DeviceIdentity deviceIdentity, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetIdentity(string deviceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIdentityAsync(string deviceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetTwin(string deviceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetTwinAsync(string deviceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetTwins(int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetTwinsAsync(int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response InvokeMethod(string deviceId, Azure.Iot.Hub.Service.Models.CloudToDeviceMethodRequest directMethodRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> InvokeMethodAsync(string deviceId, Azure.Iot.Hub.Service.Models.CloudToDeviceMethodRequest directMethodRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateIdentities(System.Collections.Generic.IEnumerable deviceIdentities, Azure.Iot.Hub.Service.BulkIfMatchPrecondition precondition = Azure.Iot.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateIdentitiesAsync(System.Collections.Generic.IEnumerable deviceIdentities, Azure.Iot.Hub.Service.BulkIfMatchPrecondition precondition = Azure.Iot.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateTwin(Azure.Iot.Hub.Service.Models.TwinData twinUpdate, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateTwinAsync(Azure.Iot.Hub.Service.Models.TwinData twinUpdate, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateTwins(System.Collections.Generic.IEnumerable twinUpdates, Azure.Iot.Hub.Service.BulkIfMatchPrecondition precondition = Azure.Iot.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateTwinsAsync(System.Collections.Generic.IEnumerable twinUpdates, Azure.Iot.Hub.Service.BulkIfMatchPrecondition precondition = Azure.Iot.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateIdentities(System.Collections.Generic.IEnumerable deviceIdentities, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateIdentitiesAsync(System.Collections.Generic.IEnumerable deviceIdentities, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateIdentitiesWithTwin(System.Collections.Generic.IDictionary devices, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateIdentitiesWithTwinAsync(System.Collections.Generic.IDictionary devices, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateOrUpdateIdentity(Azure.IoT.Hub.Service.Models.DeviceIdentity deviceIdentity, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateIdentityAsync(Azure.IoT.Hub.Service.Models.DeviceIdentity deviceIdentity, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DeleteIdentities(System.Collections.Generic.IEnumerable deviceIdentities, Azure.IoT.Hub.Service.BulkIfMatchPrecondition precondition = Azure.IoT.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DeleteIdentitiesAsync(System.Collections.Generic.IEnumerable deviceIdentities, Azure.IoT.Hub.Service.BulkIfMatchPrecondition precondition = Azure.IoT.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DeleteIdentity(Azure.IoT.Hub.Service.Models.DeviceIdentity deviceIdentity, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteIdentityAsync(Azure.IoT.Hub.Service.Models.DeviceIdentity deviceIdentity, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetIdentity(string deviceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIdentityAsync(string deviceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTwin(string deviceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetTwinAsync(string deviceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetTwins(int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTwinsAsync(int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response InvokeMethod(string deviceId, Azure.IoT.Hub.Service.Models.CloudToDeviceMethodRequest directMethodRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> InvokeMethodAsync(string deviceId, Azure.IoT.Hub.Service.Models.CloudToDeviceMethodRequest directMethodRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateIdentities(System.Collections.Generic.IEnumerable deviceIdentities, Azure.IoT.Hub.Service.BulkIfMatchPrecondition precondition = Azure.IoT.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateIdentitiesAsync(System.Collections.Generic.IEnumerable deviceIdentities, Azure.IoT.Hub.Service.BulkIfMatchPrecondition precondition = Azure.IoT.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateTwin(Azure.IoT.Hub.Service.Models.TwinData twinUpdate, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateTwinAsync(Azure.IoT.Hub.Service.Models.TwinData twinUpdate, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateTwins(System.Collections.Generic.IEnumerable twinUpdates, Azure.IoT.Hub.Service.BulkIfMatchPrecondition precondition = Azure.IoT.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateTwinsAsync(System.Collections.Generic.IEnumerable twinUpdates, Azure.IoT.Hub.Service.BulkIfMatchPrecondition precondition = Azure.IoT.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class FilesClient { @@ -64,21 +64,21 @@ public partial class IotHubServiceClient { protected IotHubServiceClient() { } public IotHubServiceClient(string connectionString) { } - public IotHubServiceClient(string connectionString, Azure.Iot.Hub.Service.IotHubServiceClientOptions options) { } - public IotHubServiceClient(System.Uri endpoint, Azure.Iot.Hub.Service.Authentication.IotHubSasCredential credential, Azure.Iot.Hub.Service.IotHubServiceClientOptions options = null) { } - public virtual Azure.Iot.Hub.Service.ConfigurationsClient Configurations { get { throw null; } } - public virtual Azure.Iot.Hub.Service.DevicesClient Devices { get { throw null; } } - public virtual Azure.Iot.Hub.Service.FilesClient Files { get { throw null; } } - public virtual Azure.Iot.Hub.Service.JobsClient Jobs { get { throw null; } } - public virtual Azure.Iot.Hub.Service.CloudToDeviceMessagesClient Messages { get { throw null; } } - public virtual Azure.Iot.Hub.Service.ModulesClient Modules { get { throw null; } } - public virtual Azure.Iot.Hub.Service.QueryClient Query { get { throw null; } } - public virtual Azure.Iot.Hub.Service.StatisticsClient Statistics { get { throw null; } } + public IotHubServiceClient(string connectionString, Azure.IoT.Hub.Service.IotHubServiceClientOptions options) { } + public IotHubServiceClient(System.Uri endpoint, Azure.IoT.Hub.Service.Authentication.IotHubSasCredential credential, Azure.IoT.Hub.Service.IotHubServiceClientOptions options = null) { } + public virtual Azure.IoT.Hub.Service.ConfigurationsClient Configurations { get { throw null; } } + public virtual Azure.IoT.Hub.Service.DevicesClient Devices { get { throw null; } } + public virtual Azure.IoT.Hub.Service.FilesClient Files { get { throw null; } } + public virtual Azure.IoT.Hub.Service.JobsClient Jobs { get { throw null; } } + public virtual Azure.IoT.Hub.Service.CloudToDeviceMessagesClient Messages { get { throw null; } } + public virtual Azure.IoT.Hub.Service.ModulesClient Modules { get { throw null; } } + public virtual Azure.IoT.Hub.Service.QueryClient Query { get { throw null; } } + public virtual Azure.IoT.Hub.Service.StatisticsClient Statistics { get { throw null; } } } public partial class IotHubServiceClientOptions : Azure.Core.ClientOptions { - public IotHubServiceClientOptions(Azure.Iot.Hub.Service.IotHubServiceClientOptions.ServiceVersion version = Azure.Iot.Hub.Service.IotHubServiceClientOptions.ServiceVersion.V2020_03_13) { } - public Azure.Iot.Hub.Service.IotHubServiceClientOptions.ServiceVersion Version { get { throw null; } } + public IotHubServiceClientOptions(Azure.IoT.Hub.Service.IotHubServiceClientOptions.ServiceVersion version = Azure.IoT.Hub.Service.IotHubServiceClientOptions.ServiceVersion.V2020_03_13) { } + public Azure.IoT.Hub.Service.IotHubServiceClientOptions.ServiceVersion Version { get { throw null; } } public enum ServiceVersion { V2020_03_13 = 1, @@ -89,61 +89,61 @@ public partial class JobsClient protected JobsClient() { } public virtual Azure.Response CancelImportExportJob(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> CancelImportExportJobAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response CreateExportDevicesJob(System.Uri outputBlobContainerUri, bool excludeKeys, Azure.Iot.Hub.Service.Models.ExportJobRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateExportDevicesJobAsync(System.Uri outputBlobContainerUri, bool excludeKeys, Azure.Iot.Hub.Service.Models.ExportJobRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response CreateImportDevicesJob(System.Uri importBlobContainerUri, System.Uri outputBlobContainerUri, Azure.Iot.Hub.Service.Models.ImportJobRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateImportDevicesJobAsync(System.Uri importBlobContainerUri, System.Uri outputBlobContainerUri, Azure.Iot.Hub.Service.Models.ImportJobRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetImportExportJob(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetImportExportJobAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response> GetImportExportJobs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task>> GetImportExportJobsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateExportDevicesJob(System.Uri outputBlobContainerUri, bool excludeKeys, Azure.IoT.Hub.Service.Models.ExportJobRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateExportDevicesJobAsync(System.Uri outputBlobContainerUri, bool excludeKeys, Azure.IoT.Hub.Service.Models.ExportJobRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateImportDevicesJob(System.Uri importBlobContainerUri, System.Uri outputBlobContainerUri, Azure.IoT.Hub.Service.Models.ImportJobRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateImportDevicesJobAsync(System.Uri importBlobContainerUri, System.Uri outputBlobContainerUri, Azure.IoT.Hub.Service.Models.ImportJobRequestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetImportExportJob(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetImportExportJobAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response> GetImportExportJobs(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task>> GetImportExportJobsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class ModulesClient { protected ModulesClient() { } - public virtual Azure.Response CreateIdentities(System.Collections.Generic.IEnumerable moduleIdentities, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateIdentitiesAsync(System.Collections.Generic.IEnumerable moduleIdentities, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response CreateIdentitiesWithTwin(System.Collections.Generic.IDictionary modules, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateIdentitiesWithTwinAsync(System.Collections.Generic.IDictionary modules, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response CreateOrUpdateIdentity(Azure.Iot.Hub.Service.Models.ModuleIdentity moduleIdentity, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateIdentityAsync(Azure.Iot.Hub.Service.Models.ModuleIdentity moduleIdentity, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response DeleteIdentities(System.Collections.Generic.IEnumerable moduleIdentities, Azure.Iot.Hub.Service.BulkIfMatchPrecondition precondition = Azure.Iot.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> DeleteIdentitiesAsync(System.Collections.Generic.IEnumerable moduleIdentities, Azure.Iot.Hub.Service.BulkIfMatchPrecondition precondition = Azure.Iot.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response DeleteIdentity(Azure.Iot.Hub.Service.Models.ModuleIdentity moduleIdentity, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteIdentityAsync(Azure.Iot.Hub.Service.Models.ModuleIdentity moduleIdentity, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response> GetIdentities(string deviceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task>> GetIdentitiesAsync(string deviceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetIdentity(string deviceId, string moduleId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIdentityAsync(string deviceId, string moduleId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetTwin(string deviceId, string moduleId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetTwinAsync(string deviceId, string moduleId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetTwins(int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetTwinsAsync(int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response InvokeMethod(string deviceId, string moduleId, Azure.Iot.Hub.Service.Models.CloudToDeviceMethodRequest directMethodRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> InvokeMethodAsync(string deviceId, string moduleId, Azure.Iot.Hub.Service.Models.CloudToDeviceMethodRequest directMethodRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateIdentities(System.Collections.Generic.IEnumerable moduleIdentities, Azure.Iot.Hub.Service.BulkIfMatchPrecondition precondition = Azure.Iot.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateIdentitiesAsync(System.Collections.Generic.IEnumerable moduleIdentities, Azure.Iot.Hub.Service.BulkIfMatchPrecondition precondition = Azure.Iot.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateTwin(Azure.Iot.Hub.Service.Models.TwinData twinUpdate, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateTwinAsync(Azure.Iot.Hub.Service.Models.TwinData twinUpdate, Azure.Iot.Hub.Service.IfMatchPrecondition precondition = Azure.Iot.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response UpdateTwins(System.Collections.Generic.IEnumerable twinUpdates, Azure.Iot.Hub.Service.BulkIfMatchPrecondition precondition = Azure.Iot.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateTwinsAsync(System.Collections.Generic.IEnumerable twinUpdates, Azure.Iot.Hub.Service.BulkIfMatchPrecondition precondition = Azure.Iot.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateIdentities(System.Collections.Generic.IEnumerable moduleIdentities, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateIdentitiesAsync(System.Collections.Generic.IEnumerable moduleIdentities, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateIdentitiesWithTwin(System.Collections.Generic.IDictionary modules, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateIdentitiesWithTwinAsync(System.Collections.Generic.IDictionary modules, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateOrUpdateIdentity(Azure.IoT.Hub.Service.Models.ModuleIdentity moduleIdentity, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateIdentityAsync(Azure.IoT.Hub.Service.Models.ModuleIdentity moduleIdentity, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DeleteIdentities(System.Collections.Generic.IEnumerable moduleIdentities, Azure.IoT.Hub.Service.BulkIfMatchPrecondition precondition = Azure.IoT.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DeleteIdentitiesAsync(System.Collections.Generic.IEnumerable moduleIdentities, Azure.IoT.Hub.Service.BulkIfMatchPrecondition precondition = Azure.IoT.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response DeleteIdentity(Azure.IoT.Hub.Service.Models.ModuleIdentity moduleIdentity, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteIdentityAsync(Azure.IoT.Hub.Service.Models.ModuleIdentity moduleIdentity, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response> GetIdentities(string deviceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task>> GetIdentitiesAsync(string deviceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetIdentity(string deviceId, string moduleId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIdentityAsync(string deviceId, string moduleId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetTwin(string deviceId, string moduleId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetTwinAsync(string deviceId, string moduleId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetTwins(int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTwinsAsync(int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response InvokeMethod(string deviceId, string moduleId, Azure.IoT.Hub.Service.Models.CloudToDeviceMethodRequest directMethodRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> InvokeMethodAsync(string deviceId, string moduleId, Azure.IoT.Hub.Service.Models.CloudToDeviceMethodRequest directMethodRequest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateIdentities(System.Collections.Generic.IEnumerable moduleIdentities, Azure.IoT.Hub.Service.BulkIfMatchPrecondition precondition = Azure.IoT.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateIdentitiesAsync(System.Collections.Generic.IEnumerable moduleIdentities, Azure.IoT.Hub.Service.BulkIfMatchPrecondition precondition = Azure.IoT.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateTwin(Azure.IoT.Hub.Service.Models.TwinData twinUpdate, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateTwinAsync(Azure.IoT.Hub.Service.Models.TwinData twinUpdate, Azure.IoT.Hub.Service.IfMatchPrecondition precondition = Azure.IoT.Hub.Service.IfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateTwins(System.Collections.Generic.IEnumerable twinUpdates, Azure.IoT.Hub.Service.BulkIfMatchPrecondition precondition = Azure.IoT.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateTwinsAsync(System.Collections.Generic.IEnumerable twinUpdates, Azure.IoT.Hub.Service.BulkIfMatchPrecondition precondition = Azure.IoT.Hub.Service.BulkIfMatchPrecondition.IfMatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class QueryClient { protected QueryClient() { } - public virtual Azure.Pageable Query(string query, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable QueryAsync(string query, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable Query(string query, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable QueryAsync(string query, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class StatisticsClient { protected StatisticsClient() { } - public virtual Azure.Response GetDevicesStatistics(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetDevicesStatisticsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetServiceStatistics(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetServiceStatisticsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDevicesStatistics(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDevicesStatisticsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetServiceStatistics(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetServiceStatisticsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } -namespace Azure.Iot.Hub.Service.Authentication +namespace Azure.IoT.Hub.Service.Authentication { public partial class IotHubSasCredential : Azure.Core.TokenCredential { @@ -156,41 +156,41 @@ public partial class IotHubSasCredential : Azure.Core.TokenCredential public override System.Threading.Tasks.ValueTask GetTokenAsync(Azure.Core.TokenRequestContext requestContext, System.Threading.CancellationToken cancellationToken) { throw null; } } } -namespace Azure.Iot.Hub.Service.Models +namespace Azure.IoT.Hub.Service.Models { public partial class AuthenticationMechanism { public AuthenticationMechanism() { } - public Azure.Iot.Hub.Service.Models.SymmetricKey SymmetricKey { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.AuthenticationMechanismType? Type { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.X509Thumbprint X509Thumbprint { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.SymmetricKey SymmetricKey { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.AuthenticationMechanismType? Type { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.X509Thumbprint X509Thumbprint { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct AuthenticationMechanismType : System.IEquatable + public readonly partial struct AuthenticationMechanismType : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public AuthenticationMechanismType(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.AuthenticationMechanismType CertificateAuthority { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.AuthenticationMechanismType None { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.AuthenticationMechanismType Sas { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.AuthenticationMechanismType SelfSigned { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.AuthenticationMechanismType other) { throw null; } + public static Azure.IoT.Hub.Service.Models.AuthenticationMechanismType CertificateAuthority { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.AuthenticationMechanismType None { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.AuthenticationMechanismType Sas { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.AuthenticationMechanismType SelfSigned { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.AuthenticationMechanismType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.AuthenticationMechanismType left, Azure.Iot.Hub.Service.Models.AuthenticationMechanismType right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.AuthenticationMechanismType (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.AuthenticationMechanismType left, Azure.Iot.Hub.Service.Models.AuthenticationMechanismType right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.AuthenticationMechanismType left, Azure.IoT.Hub.Service.Models.AuthenticationMechanismType right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.AuthenticationMechanismType (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.AuthenticationMechanismType left, Azure.IoT.Hub.Service.Models.AuthenticationMechanismType right) { throw null; } public override string ToString() { throw null; } } public partial class BulkRegistryOperationResponse { internal BulkRegistryOperationResponse() { } - public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } public bool? IsSuccessful { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Warnings { get { throw null; } } } public partial class CloudToDeviceMethodRequest { @@ -237,37 +237,37 @@ public DeviceCapabilities() { } public bool? IsIotEdgeDevice { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DeviceConnectionState : System.IEquatable + public readonly partial struct DeviceConnectionState : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public DeviceConnectionState(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.DeviceConnectionState Connected { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceConnectionState Disconnected { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.DeviceConnectionState other) { throw null; } + public static Azure.IoT.Hub.Service.Models.DeviceConnectionState Connected { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceConnectionState Disconnected { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.DeviceConnectionState other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.DeviceConnectionState left, Azure.Iot.Hub.Service.Models.DeviceConnectionState right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.DeviceConnectionState (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.DeviceConnectionState left, Azure.Iot.Hub.Service.Models.DeviceConnectionState right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.DeviceConnectionState left, Azure.IoT.Hub.Service.Models.DeviceConnectionState right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.DeviceConnectionState (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.DeviceConnectionState left, Azure.IoT.Hub.Service.Models.DeviceConnectionState right) { throw null; } public override string ToString() { throw null; } } public partial class DeviceIdentity { public DeviceIdentity() { } - public Azure.Iot.Hub.Service.Models.AuthenticationMechanism Authentication { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.DeviceCapabilities Capabilities { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.AuthenticationMechanism Authentication { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.DeviceCapabilities Capabilities { get { throw null; } set { } } public int? CloudToDeviceMessageCount { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.DeviceConnectionState? ConnectionState { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.DeviceConnectionState? ConnectionState { get { throw null; } set { } } public System.DateTimeOffset? ConnectionStateUpdatedTime { get { throw null; } set { } } public string DeviceId { get { throw null; } set { } } public string DeviceScope { get { throw null; } set { } } public string Etag { get { throw null; } set { } } public string GenerationId { get { throw null; } set { } } public System.DateTimeOffset? LastActivityTime { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.DeviceStatus? Status { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.DeviceStatus? Status { get { throw null; } set { } } public string StatusReason { get { throw null; } set { } } public System.DateTimeOffset? StatusUpdatedTime { get { throw null; } set { } } } @@ -284,241 +284,241 @@ public partial class DeviceRegistryOperationError { internal DeviceRegistryOperationError() { } public string DeviceId { get { throw null; } } - public Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode? ErrorCode { get { throw null; } } + public Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode? ErrorCode { get { throw null; } } public string ErrorStatus { get { throw null; } } public string ModuleId { get { throw null; } } public string Operation { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DeviceRegistryOperationErrorCode : System.IEquatable + public readonly partial struct DeviceRegistryOperationErrorCode : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public DeviceRegistryOperationErrorCode(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode AmqpAddressNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ApplyConfigurationAlreadyInProgressOnDevice { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ArgumentInvalid { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ArgumentNull { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode AsyncOperationNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode AzureStorageTimeout { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode AzureTableStoreError { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode AzureTableStoreNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode BackupTimedOut { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode BlobContainerValidationError { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode BulkAddDevicesNotSupported { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode BulkRegistryOperationFailure { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode CallbackSubscriptionConflict { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode CannotModifyImmutableConfigurationContent { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode CannotRegisterModuleToModule { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode CertificateAuthorityConflict { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode CertificateAuthorityNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode CertificateNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode CheckpointStoreNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ClientClosedRequest { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ConfigReadFailed { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ConfigurationAlreadyExists { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ConfigurationCountLimitExceeded { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ConfigurationNotAvailable { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ConfigurationNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ConnectionForcefullyClosed { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ConnectionForcefullyClosedOnFaultInjection { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ConnectionForcefullyClosedOnNewConnection { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ConnectionRejectedOnFaultInjection { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ConnectionUnavailable { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode CustomAllocationFailed { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode CustomAllocationIotHubNotSpecified { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode CustomAllocationUnauthorizedAccess { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DefaultStorageEndpointNotConfigured { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeserializationError { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceAlreadyExists { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceConnectionClosedRemotely { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceDefinedMultipleTimes { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceGroupConflict { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceGroupNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceInvalidResultCount { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceJobAlreadyExists { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceLocked { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceMaximumActiveFileUploadLimitExceeded { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceMaximumQueueDepthExceeded { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceMaximumQueueSizeExceeded { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceMessageLockLost { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceModelMaxIndexablePropertiesExceeded { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceModelMaxPropertiesExceeded { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceNotOnline { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceRecordConflict { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceRecordNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceRegistrationNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceStorageEntitySerializationError { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceThrottlingLimitExceeded { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceUnavailable { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DigitalTwinInterfaceNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DigitalTwinModelAlreadyExists { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DigitalTwinModelCountLimitExceeded { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DigitalTwinModelExistsWithOtherModelType { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DigitalTwinModelNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode DocumentDbInvalidReturnValue { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ElasticPoolNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ElasticPoolTenantHubNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode EnrollmentConflict { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode EnrollmentGroupConflict { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode EnrollmentGroupNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode EnrollmentNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode EtagDoesNotMatch { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode EventHubLinkAlreadyClosed { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ExpiredFileUploadCorrelationId { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode FeatureNotSupported { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GatewayTimeout { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericBadGateway { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericBadRequest { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericConflict { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericForbidden { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericGatewayTimeout { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericMethodNotAllowed { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericPreconditionFailed { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericRequestEntityTooLarge { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericServerError { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericServiceUnavailable { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericTimeout { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericTooManyRequests { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericUnauthorized { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericUnsupportedMediaType { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GroupNotAvailable { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GroupNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GroupRecordConflict { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode GroupRecordNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode HostingServiceNotAvailable { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ImportDevicesNotSupported { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ImportWarningExistsError { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode IncompatibleDataType { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InflightMessagesInLink { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InterfaceNameCompressionModelCountLimitExceeded { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InterfaceNameModelAlreadyExists { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InterfaceNameModelNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidBlobState { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidConfigurationContent { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidConfigurationCustomMetricsQuery { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidConfigurationTargetCondition { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidContainerReceiveLink { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidContentEncodingOrType { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidDeviceScope { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidDigitalTwinJsonPatch { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidDigitalTwinPatch { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidDigitalTwinPatchPath { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidDigitalTwinPayload { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidEndorsementKey { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidEndpointAuthenticationType { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidEnrollmentGroupId { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidErrorCode { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidFileUploadCompletionStatus { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidFileUploadCorrelationId { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidMessageExpiryTime { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidMessagingEndpoint { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidOperation { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidPartitionEpoch { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidPnPDesiredProperties { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidPnPInterfaceDefinition { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidPnPReportedProperties { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidPnPWritableReportedProperties { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidProtocolVersion { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidRegistrationId { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidResponseWhileProxying { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidRouteTestInput { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidSchemaVersion { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidSourceOnRoute { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidStorageEndpoint { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidStorageEndpointOrBlob { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidStorageEndpointProperty { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidStorageRootKey { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidThrottleParameter { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode IotDpsSuspended { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode IotDpsSuspending { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubActivationFailed { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubFailingOver { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubFormatError { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubMaxCbsTokenExceeded { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubQuotaExceeded { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubRestoring { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubSuspended { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubUnauthorized { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubUnauthorizedAccess { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode JobAlreadyExists { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode JobCancelled { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode JobNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode JobQuotaExceeded { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode JobRunPreconditionFailed { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode KeyEncryptionKeyRevoked { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode LinkCreationConflict { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode LinkedHubConflict { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode LinkedHubNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ManagedIdentityNotEnabled { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode MessageTooLarge { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ModelAlreadyExists { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ModelRepoEndpointError { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ModuleAlreadyExistsOnDevice { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ModuleNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode NullMessage { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode OperationNotAllowedInCurrentState { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode OperationNotAvailableInCurrentTier { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode OrchestrationOperationFailed { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode OrphanDiscoveryDocument { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode PartitionNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode PreconditionFailed { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ProvisioningRecordConflict { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ProvisioningRecordNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ProvisioningSettingsConflict { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ProvisioningSettingsNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode QueryStoreClusterNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode QuotaMetricNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ReceiveLinkOpensThrottled { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode RegistrationIdDefinedMultipleTimes { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode RegistrationStatusConflict { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ReliableBlobStoreError { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ReliableBlobStoreTimeoutError { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ReliableDocDbStoreStoreError { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode RequestCanceled { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode RequestTimedOut { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ResolutionError { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode RestoreTimedOut { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode RetryAttemptsExhausted { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode RoutingEndpointResponseForbidden { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode RoutingEndpointResponseNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode RoutingNotEnabled { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode SerializationError { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ServerBusy { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ServerError { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ServiceUnavailable { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode StatisticsRetrievalError { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode StreamReservationFailure { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode SystemModuleModifyUnauthorizedAccess { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode SystemPropertyNotFound { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode TenantHubRoutingNotEnabled { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ThrottleBacklogLimitExceeded { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ThrottlingBacklogTimeout { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ThrottlingException { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode ThrottlingMaxActiveJobCountExceeded { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode TooManyDevices { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode TooManyEnrollments { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode TooManyModulesOnDevice { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode UnableToCompressComponentInfo { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode UnableToCompressDiscoveryInfo { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode UnableToExpandComponentInfo { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode UnableToExpandDiscoveryInfo { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode UnableToFetchCredentials { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode UnableToFetchTenantInfo { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode UnableToShareIdentity { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode UnexpectedPropertyValue { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode UnsupportedOperationOnReplica { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode other) { throw null; } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode AmqpAddressNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ApplyConfigurationAlreadyInProgressOnDevice { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ArgumentInvalid { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ArgumentNull { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode AsyncOperationNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode AzureStorageTimeout { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode AzureTableStoreError { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode AzureTableStoreNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode BackupTimedOut { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode BlobContainerValidationError { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode BulkAddDevicesNotSupported { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode BulkRegistryOperationFailure { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode CallbackSubscriptionConflict { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode CannotModifyImmutableConfigurationContent { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode CannotRegisterModuleToModule { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode CertificateAuthorityConflict { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode CertificateAuthorityNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode CertificateNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode CheckpointStoreNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ClientClosedRequest { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ConfigReadFailed { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ConfigurationAlreadyExists { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ConfigurationCountLimitExceeded { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ConfigurationNotAvailable { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ConfigurationNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ConnectionForcefullyClosed { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ConnectionForcefullyClosedOnFaultInjection { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ConnectionForcefullyClosedOnNewConnection { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ConnectionRejectedOnFaultInjection { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ConnectionUnavailable { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode CustomAllocationFailed { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode CustomAllocationIotHubNotSpecified { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode CustomAllocationUnauthorizedAccess { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DefaultStorageEndpointNotConfigured { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeserializationError { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceAlreadyExists { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceConnectionClosedRemotely { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceDefinedMultipleTimes { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceGroupConflict { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceGroupNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceInvalidResultCount { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceJobAlreadyExists { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceLocked { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceMaximumActiveFileUploadLimitExceeded { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceMaximumQueueDepthExceeded { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceMaximumQueueSizeExceeded { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceMessageLockLost { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceModelMaxIndexablePropertiesExceeded { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceModelMaxPropertiesExceeded { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceNotOnline { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceRecordConflict { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceRecordNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceRegistrationNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceStorageEntitySerializationError { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceThrottlingLimitExceeded { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DeviceUnavailable { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DigitalTwinInterfaceNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DigitalTwinModelAlreadyExists { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DigitalTwinModelCountLimitExceeded { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DigitalTwinModelExistsWithOtherModelType { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DigitalTwinModelNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode DocumentDbInvalidReturnValue { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ElasticPoolNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ElasticPoolTenantHubNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode EnrollmentConflict { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode EnrollmentGroupConflict { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode EnrollmentGroupNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode EnrollmentNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode EtagDoesNotMatch { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode EventHubLinkAlreadyClosed { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ExpiredFileUploadCorrelationId { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode FeatureNotSupported { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GatewayTimeout { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericBadGateway { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericBadRequest { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericConflict { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericForbidden { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericGatewayTimeout { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericMethodNotAllowed { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericPreconditionFailed { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericRequestEntityTooLarge { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericServerError { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericServiceUnavailable { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericTimeout { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericTooManyRequests { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericUnauthorized { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GenericUnsupportedMediaType { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GroupNotAvailable { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GroupNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GroupRecordConflict { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode GroupRecordNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode HostingServiceNotAvailable { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ImportDevicesNotSupported { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ImportWarningExistsError { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode IncompatibleDataType { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InflightMessagesInLink { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InterfaceNameCompressionModelCountLimitExceeded { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InterfaceNameModelAlreadyExists { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InterfaceNameModelNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidBlobState { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidConfigurationContent { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidConfigurationCustomMetricsQuery { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidConfigurationTargetCondition { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidContainerReceiveLink { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidContentEncodingOrType { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidDeviceScope { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidDigitalTwinJsonPatch { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidDigitalTwinPatch { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidDigitalTwinPatchPath { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidDigitalTwinPayload { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidEndorsementKey { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidEndpointAuthenticationType { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidEnrollmentGroupId { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidErrorCode { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidFileUploadCompletionStatus { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidFileUploadCorrelationId { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidMessageExpiryTime { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidMessagingEndpoint { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidOperation { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidPartitionEpoch { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidPnPDesiredProperties { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidPnPInterfaceDefinition { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidPnPReportedProperties { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidPnPWritableReportedProperties { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidProtocolVersion { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidRegistrationId { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidResponseWhileProxying { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidRouteTestInput { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidSchemaVersion { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidSourceOnRoute { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidStorageEndpoint { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidStorageEndpointOrBlob { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidStorageEndpointProperty { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidStorageRootKey { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode InvalidThrottleParameter { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode IotDpsSuspended { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode IotDpsSuspending { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubActivationFailed { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubFailingOver { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubFormatError { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubMaxCbsTokenExceeded { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubQuotaExceeded { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubRestoring { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubSuspended { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubUnauthorized { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode IotHubUnauthorizedAccess { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode JobAlreadyExists { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode JobCancelled { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode JobNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode JobQuotaExceeded { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode JobRunPreconditionFailed { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode KeyEncryptionKeyRevoked { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode LinkCreationConflict { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode LinkedHubConflict { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode LinkedHubNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ManagedIdentityNotEnabled { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode MessageTooLarge { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ModelAlreadyExists { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ModelRepoEndpointError { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ModuleAlreadyExistsOnDevice { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ModuleNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode NullMessage { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode OperationNotAllowedInCurrentState { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode OperationNotAvailableInCurrentTier { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode OrchestrationOperationFailed { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode OrphanDiscoveryDocument { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode PartitionNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode PreconditionFailed { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ProvisioningRecordConflict { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ProvisioningRecordNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ProvisioningSettingsConflict { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ProvisioningSettingsNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode QueryStoreClusterNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode QuotaMetricNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ReceiveLinkOpensThrottled { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode RegistrationIdDefinedMultipleTimes { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode RegistrationStatusConflict { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ReliableBlobStoreError { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ReliableBlobStoreTimeoutError { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ReliableDocDbStoreStoreError { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode RequestCanceled { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode RequestTimedOut { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ResolutionError { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode RestoreTimedOut { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode RetryAttemptsExhausted { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode RoutingEndpointResponseForbidden { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode RoutingEndpointResponseNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode RoutingNotEnabled { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode SerializationError { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ServerBusy { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ServerError { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ServiceUnavailable { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode StatisticsRetrievalError { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode StreamReservationFailure { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode SystemModuleModifyUnauthorizedAccess { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode SystemPropertyNotFound { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode TenantHubRoutingNotEnabled { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ThrottleBacklogLimitExceeded { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ThrottlingBacklogTimeout { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ThrottlingException { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode ThrottlingMaxActiveJobCountExceeded { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode TooManyDevices { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode TooManyEnrollments { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode TooManyModulesOnDevice { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode UnableToCompressComponentInfo { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode UnableToCompressDiscoveryInfo { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode UnableToExpandComponentInfo { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode UnableToExpandDiscoveryInfo { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode UnableToFetchCredentials { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode UnableToFetchTenantInfo { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode UnableToShareIdentity { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode UnexpectedPropertyValue { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode UnsupportedOperationOnReplica { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode left, Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode left, Azure.Iot.Hub.Service.Models.DeviceRegistryOperationErrorCode right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode left, Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode left, Azure.IoT.Hub.Service.Models.DeviceRegistryOperationErrorCode right) { throw null; } public override string ToString() { throw null; } } public partial class DeviceRegistryOperationWarning @@ -536,86 +536,86 @@ internal DevicesStatistics() { } public long? TotalDeviceCount { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct DeviceStatus : System.IEquatable + public readonly partial struct DeviceStatus : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public DeviceStatus(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.DeviceStatus Disabled { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.DeviceStatus Enabled { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.DeviceStatus other) { throw null; } + public static Azure.IoT.Hub.Service.Models.DeviceStatus Disabled { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.DeviceStatus Enabled { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.DeviceStatus other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.DeviceStatus left, Azure.Iot.Hub.Service.Models.DeviceStatus right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.DeviceStatus (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.DeviceStatus left, Azure.Iot.Hub.Service.Models.DeviceStatus right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.DeviceStatus left, Azure.IoT.Hub.Service.Models.DeviceStatus right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.DeviceStatus (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.DeviceStatus left, Azure.IoT.Hub.Service.Models.DeviceStatus right) { throw null; } public override string ToString() { throw null; } } public partial class ExportImportDevice { public ExportImportDevice() { } - public Azure.Iot.Hub.Service.Models.AuthenticationMechanism Authentication { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.DeviceCapabilities Capabilities { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.AuthenticationMechanism Authentication { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.DeviceCapabilities Capabilities { get { throw null; } set { } } public string DeviceScope { get { throw null; } set { } } public string ETag { get { throw null; } set { } } public string Id { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.ExportImportDeviceImportMode? ImportMode { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.ExportImportDeviceImportMode? ImportMode { get { throw null; } set { } } public string ModuleId { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.PropertyContainer Properties { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.ExportImportDeviceStatus? Status { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.PropertyContainer Properties { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.ExportImportDeviceStatus? Status { get { throw null; } set { } } public string StatusReason { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } public string TwinETag { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ExportImportDeviceImportMode : System.IEquatable + public readonly partial struct ExportImportDeviceImportMode : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public ExportImportDeviceImportMode(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.ExportImportDeviceImportMode Create { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.ExportImportDeviceImportMode Delete { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.ExportImportDeviceImportMode DeleteIfMatchETag { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.ExportImportDeviceImportMode Update { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.ExportImportDeviceImportMode UpdateIfMatchETag { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.ExportImportDeviceImportMode UpdateTwin { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.ExportImportDeviceImportMode UpdateTwinIfMatchETag { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.ExportImportDeviceImportMode other) { throw null; } + public static Azure.IoT.Hub.Service.Models.ExportImportDeviceImportMode Create { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.ExportImportDeviceImportMode Delete { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.ExportImportDeviceImportMode DeleteIfMatchETag { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.ExportImportDeviceImportMode Update { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.ExportImportDeviceImportMode UpdateIfMatchETag { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.ExportImportDeviceImportMode UpdateTwin { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.ExportImportDeviceImportMode UpdateTwinIfMatchETag { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.ExportImportDeviceImportMode other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.ExportImportDeviceImportMode left, Azure.Iot.Hub.Service.Models.ExportImportDeviceImportMode right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.ExportImportDeviceImportMode (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.ExportImportDeviceImportMode left, Azure.Iot.Hub.Service.Models.ExportImportDeviceImportMode right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.ExportImportDeviceImportMode left, Azure.IoT.Hub.Service.Models.ExportImportDeviceImportMode right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.ExportImportDeviceImportMode (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.ExportImportDeviceImportMode left, Azure.IoT.Hub.Service.Models.ExportImportDeviceImportMode right) { throw null; } public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ExportImportDeviceStatus : System.IEquatable + public readonly partial struct ExportImportDeviceStatus : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public ExportImportDeviceStatus(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.ExportImportDeviceStatus Disabled { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.ExportImportDeviceStatus Enabled { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.ExportImportDeviceStatus other) { throw null; } + public static Azure.IoT.Hub.Service.Models.ExportImportDeviceStatus Disabled { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.ExportImportDeviceStatus Enabled { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.ExportImportDeviceStatus other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.ExportImportDeviceStatus left, Azure.Iot.Hub.Service.Models.ExportImportDeviceStatus right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.ExportImportDeviceStatus (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.ExportImportDeviceStatus left, Azure.Iot.Hub.Service.Models.ExportImportDeviceStatus right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.ExportImportDeviceStatus left, Azure.IoT.Hub.Service.Models.ExportImportDeviceStatus right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.ExportImportDeviceStatus (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.ExportImportDeviceStatus left, Azure.IoT.Hub.Service.Models.ExportImportDeviceStatus right) { throw null; } public override string ToString() { throw null; } } - public partial class ExportJobRequestOptions : Azure.Iot.Hub.Service.Models.JobRequestOptions + public partial class ExportJobRequestOptions : Azure.IoT.Hub.Service.Models.JobRequestOptions { public ExportJobRequestOptions() { } public string OutputBlobName { get { throw null; } set { } } } - public partial class ImportJobRequestOptions : Azure.Iot.Hub.Service.Models.JobRequestOptions + public partial class ImportJobRequestOptions : Azure.IoT.Hub.Service.Models.JobRequestOptions { public ImportJobRequestOptions() { } public string InputBlobName { get { throw null; } set { } } @@ -636,223 +636,223 @@ public JobProperties() { } public string OutputBlobName { get { throw null; } set { } } public int? Progress { get { throw null; } set { } } public System.DateTimeOffset? StartTimeUtc { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.JobPropertiesStatus? Status { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.JobPropertiesStorageAuthenticationType? StorageAuthenticationType { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.JobPropertiesType? Type { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.JobPropertiesStatus? Status { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.JobPropertiesStorageAuthenticationType? StorageAuthenticationType { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.JobPropertiesType? Type { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct JobPropertiesStatus : System.IEquatable + public readonly partial struct JobPropertiesStatus : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public JobPropertiesStatus(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.JobPropertiesStatus Cancelled { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesStatus Completed { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesStatus Enqueued { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesStatus Failed { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesStatus Queued { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesStatus Running { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesStatus Scheduled { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesStatus Unknown { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.JobPropertiesStatus other) { throw null; } + public static Azure.IoT.Hub.Service.Models.JobPropertiesStatus Cancelled { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesStatus Completed { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesStatus Enqueued { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesStatus Failed { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesStatus Queued { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesStatus Running { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesStatus Scheduled { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesStatus Unknown { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.JobPropertiesStatus other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.JobPropertiesStatus left, Azure.Iot.Hub.Service.Models.JobPropertiesStatus right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.JobPropertiesStatus (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.JobPropertiesStatus left, Azure.Iot.Hub.Service.Models.JobPropertiesStatus right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.JobPropertiesStatus left, Azure.IoT.Hub.Service.Models.JobPropertiesStatus right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.JobPropertiesStatus (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.JobPropertiesStatus left, Azure.IoT.Hub.Service.Models.JobPropertiesStatus right) { throw null; } public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct JobPropertiesStorageAuthenticationType : System.IEquatable + public readonly partial struct JobPropertiesStorageAuthenticationType : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public JobPropertiesStorageAuthenticationType(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.JobPropertiesStorageAuthenticationType IdentityBased { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesStorageAuthenticationType KeyBased { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.JobPropertiesStorageAuthenticationType other) { throw null; } + public static Azure.IoT.Hub.Service.Models.JobPropertiesStorageAuthenticationType IdentityBased { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesStorageAuthenticationType KeyBased { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.JobPropertiesStorageAuthenticationType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.JobPropertiesStorageAuthenticationType left, Azure.Iot.Hub.Service.Models.JobPropertiesStorageAuthenticationType right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.JobPropertiesStorageAuthenticationType (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.JobPropertiesStorageAuthenticationType left, Azure.Iot.Hub.Service.Models.JobPropertiesStorageAuthenticationType right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.JobPropertiesStorageAuthenticationType left, Azure.IoT.Hub.Service.Models.JobPropertiesStorageAuthenticationType right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.JobPropertiesStorageAuthenticationType (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.JobPropertiesStorageAuthenticationType left, Azure.IoT.Hub.Service.Models.JobPropertiesStorageAuthenticationType right) { throw null; } public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct JobPropertiesType : System.IEquatable + public readonly partial struct JobPropertiesType : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public JobPropertiesType(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.JobPropertiesType Backup { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesType Export { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesType FactoryResetDevice { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesType FailoverDataCopy { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesType FirmwareUpdate { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesType Import { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesType ReadDeviceProperties { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesType RebootDevice { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesType RestoreFromBackup { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesType ScheduleDeviceMethod { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesType ScheduleUpdateTwin { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesType Unknown { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesType UpdateDeviceConfiguration { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobPropertiesType WriteDeviceProperties { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.JobPropertiesType other) { throw null; } + public static Azure.IoT.Hub.Service.Models.JobPropertiesType Backup { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesType Export { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesType FactoryResetDevice { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesType FailoverDataCopy { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesType FirmwareUpdate { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesType Import { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesType ReadDeviceProperties { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesType RebootDevice { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesType RestoreFromBackup { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesType ScheduleDeviceMethod { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesType ScheduleUpdateTwin { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesType Unknown { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesType UpdateDeviceConfiguration { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobPropertiesType WriteDeviceProperties { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.JobPropertiesType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.JobPropertiesType left, Azure.Iot.Hub.Service.Models.JobPropertiesType right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.JobPropertiesType (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.JobPropertiesType left, Azure.Iot.Hub.Service.Models.JobPropertiesType right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.JobPropertiesType left, Azure.IoT.Hub.Service.Models.JobPropertiesType right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.JobPropertiesType (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.JobPropertiesType left, Azure.IoT.Hub.Service.Models.JobPropertiesType right) { throw null; } public override string ToString() { throw null; } } public partial class JobRequest { public JobRequest() { } - public Azure.Iot.Hub.Service.Models.CloudToDeviceMethodRequest CloudToDeviceMethod { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.CloudToDeviceMethodRequest CloudToDeviceMethod { get { throw null; } set { } } public string JobId { get { throw null; } set { } } public long? MaxExecutionTimeInSeconds { get { throw null; } set { } } public string QueryCondition { get { throw null; } set { } } public System.DateTimeOffset? StartTime { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.JobRequestType? Type { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.TwinData UpdateTwin { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.JobRequestType? Type { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.TwinData UpdateTwin { get { throw null; } set { } } } public partial class JobRequestOptions { public JobRequestOptions() { } - public Azure.Iot.Hub.Service.Models.JobPropertiesStorageAuthenticationType AuthenticationType { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.JobPropertiesStorageAuthenticationType AuthenticationType { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct JobRequestType : System.IEquatable + public readonly partial struct JobRequestType : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public JobRequestType(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.JobRequestType Backup { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobRequestType Export { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobRequestType FactoryResetDevice { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobRequestType FailoverDataCopy { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobRequestType FirmwareUpdate { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobRequestType Import { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobRequestType ReadDeviceProperties { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobRequestType RebootDevice { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobRequestType RestoreFromBackup { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobRequestType ScheduleDeviceMethod { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobRequestType ScheduleUpdateTwin { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobRequestType Unknown { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobRequestType UpdateDeviceConfiguration { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobRequestType WriteDeviceProperties { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.JobRequestType other) { throw null; } + public static Azure.IoT.Hub.Service.Models.JobRequestType Backup { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobRequestType Export { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobRequestType FactoryResetDevice { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobRequestType FailoverDataCopy { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobRequestType FirmwareUpdate { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobRequestType Import { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobRequestType ReadDeviceProperties { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobRequestType RebootDevice { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobRequestType RestoreFromBackup { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobRequestType ScheduleDeviceMethod { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobRequestType ScheduleUpdateTwin { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobRequestType Unknown { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobRequestType UpdateDeviceConfiguration { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobRequestType WriteDeviceProperties { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.JobRequestType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.JobRequestType left, Azure.Iot.Hub.Service.Models.JobRequestType right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.JobRequestType (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.JobRequestType left, Azure.Iot.Hub.Service.Models.JobRequestType right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.JobRequestType left, Azure.IoT.Hub.Service.Models.JobRequestType right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.JobRequestType (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.JobRequestType left, Azure.IoT.Hub.Service.Models.JobRequestType right) { throw null; } public override string ToString() { throw null; } } public partial class JobResponse { internal JobResponse() { } - public Azure.Iot.Hub.Service.Models.CloudToDeviceMethodRequest CloudToDeviceMethod { get { throw null; } } + public Azure.IoT.Hub.Service.Models.CloudToDeviceMethodRequest CloudToDeviceMethod { get { throw null; } } public System.DateTimeOffset? CreatedTime { get { throw null; } } - public Azure.Iot.Hub.Service.Models.DeviceJobStatistics DeviceJobStatistics { get { throw null; } } + public Azure.IoT.Hub.Service.Models.DeviceJobStatistics DeviceJobStatistics { get { throw null; } } public System.DateTimeOffset? EndTime { get { throw null; } } public string FailureReason { get { throw null; } } public string JobId { get { throw null; } } public long? MaxExecutionTimeInSeconds { get { throw null; } } public string QueryCondition { get { throw null; } } public System.DateTimeOffset? StartTime { get { throw null; } } - public Azure.Iot.Hub.Service.Models.JobResponseStatus? Status { get { throw null; } } + public Azure.IoT.Hub.Service.Models.JobResponseStatus? Status { get { throw null; } } public string StatusMessage { get { throw null; } } - public Azure.Iot.Hub.Service.Models.JobResponseType? Type { get { throw null; } } - public Azure.Iot.Hub.Service.Models.TwinData UpdateTwin { get { throw null; } } + public Azure.IoT.Hub.Service.Models.JobResponseType? Type { get { throw null; } } + public Azure.IoT.Hub.Service.Models.TwinData UpdateTwin { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct JobResponseStatus : System.IEquatable + public readonly partial struct JobResponseStatus : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public JobResponseStatus(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.JobResponseStatus Cancelled { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseStatus Completed { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseStatus Enqueued { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseStatus Failed { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseStatus Queued { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseStatus Running { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseStatus Scheduled { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseStatus Unknown { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.JobResponseStatus other) { throw null; } + public static Azure.IoT.Hub.Service.Models.JobResponseStatus Cancelled { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseStatus Completed { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseStatus Enqueued { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseStatus Failed { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseStatus Queued { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseStatus Running { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseStatus Scheduled { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseStatus Unknown { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.JobResponseStatus other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.JobResponseStatus left, Azure.Iot.Hub.Service.Models.JobResponseStatus right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.JobResponseStatus (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.JobResponseStatus left, Azure.Iot.Hub.Service.Models.JobResponseStatus right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.JobResponseStatus left, Azure.IoT.Hub.Service.Models.JobResponseStatus right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.JobResponseStatus (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.JobResponseStatus left, Azure.IoT.Hub.Service.Models.JobResponseStatus right) { throw null; } public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct JobResponseType : System.IEquatable + public readonly partial struct JobResponseType : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public JobResponseType(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.JobResponseType Backup { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseType Export { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseType FactoryResetDevice { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseType FailoverDataCopy { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseType FirmwareUpdate { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseType Import { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseType ReadDeviceProperties { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseType RebootDevice { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseType RestoreFromBackup { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseType ScheduleDeviceMethod { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseType ScheduleUpdateTwin { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseType Unknown { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseType UpdateDeviceConfiguration { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.JobResponseType WriteDeviceProperties { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.JobResponseType other) { throw null; } + public static Azure.IoT.Hub.Service.Models.JobResponseType Backup { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseType Export { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseType FactoryResetDevice { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseType FailoverDataCopy { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseType FirmwareUpdate { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseType Import { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseType ReadDeviceProperties { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseType RebootDevice { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseType RestoreFromBackup { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseType ScheduleDeviceMethod { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseType ScheduleUpdateTwin { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseType Unknown { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseType UpdateDeviceConfiguration { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.JobResponseType WriteDeviceProperties { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.JobResponseType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.JobResponseType left, Azure.Iot.Hub.Service.Models.JobResponseType right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.JobResponseType (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.JobResponseType left, Azure.Iot.Hub.Service.Models.JobResponseType right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.JobResponseType left, Azure.IoT.Hub.Service.Models.JobResponseType right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.JobResponseType (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.JobResponseType left, Azure.IoT.Hub.Service.Models.JobResponseType right) { throw null; } public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ModuleConnectionState : System.IEquatable + public readonly partial struct ModuleConnectionState : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public ModuleConnectionState(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.ModuleConnectionState Connected { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.ModuleConnectionState Disconnected { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.ModuleConnectionState other) { throw null; } + public static Azure.IoT.Hub.Service.Models.ModuleConnectionState Connected { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.ModuleConnectionState Disconnected { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.ModuleConnectionState other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.ModuleConnectionState left, Azure.Iot.Hub.Service.Models.ModuleConnectionState right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.ModuleConnectionState (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.ModuleConnectionState left, Azure.Iot.Hub.Service.Models.ModuleConnectionState right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.ModuleConnectionState left, Azure.IoT.Hub.Service.Models.ModuleConnectionState right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.ModuleConnectionState (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.ModuleConnectionState left, Azure.IoT.Hub.Service.Models.ModuleConnectionState right) { throw null; } public override string ToString() { throw null; } } public partial class ModuleIdentity { public ModuleIdentity() { } - public Azure.Iot.Hub.Service.Models.AuthenticationMechanism Authentication { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.AuthenticationMechanism Authentication { get { throw null; } set { } } public int? CloudToDeviceMessageCount { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.ModuleConnectionState? ConnectionState { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.ModuleConnectionState? ConnectionState { get { throw null; } set { } } public System.DateTimeOffset? ConnectionStateUpdatedTime { get { throw null; } set { } } public string DeviceId { get { throw null; } set { } } public string Etag { get { throw null; } set { } } @@ -879,30 +879,30 @@ public partial class QueryResult internal QueryResult() { } public string ContinuationToken { get { throw null; } } public System.Collections.Generic.IReadOnlyList Items { get { throw null; } } - public Azure.Iot.Hub.Service.Models.QueryResultType? Type { get { throw null; } } + public Azure.IoT.Hub.Service.Models.QueryResultType? Type { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct QueryResultType : System.IEquatable + public readonly partial struct QueryResultType : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public QueryResultType(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.QueryResultType DeviceJob { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.QueryResultType DeviceRegistration { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.QueryResultType Enrollment { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.QueryResultType EnrollmentGroup { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.QueryResultType JobResponse { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.QueryResultType Raw { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.QueryResultType Twin { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.QueryResultType Unknown { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.QueryResultType other) { throw null; } + public static Azure.IoT.Hub.Service.Models.QueryResultType DeviceJob { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.QueryResultType DeviceRegistration { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.QueryResultType Enrollment { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.QueryResultType EnrollmentGroup { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.QueryResultType JobResponse { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.QueryResultType Raw { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.QueryResultType Twin { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.QueryResultType Unknown { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.QueryResultType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.QueryResultType left, Azure.Iot.Hub.Service.Models.QueryResultType right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.QueryResultType (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.QueryResultType left, Azure.Iot.Hub.Service.Models.QueryResultType right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.QueryResultType left, Azure.IoT.Hub.Service.Models.QueryResultType right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.QueryResultType (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.QueryResultType left, Azure.IoT.Hub.Service.Models.QueryResultType right) { throw null; } public override string ToString() { throw null; } } public partial class QuerySpecification @@ -922,78 +922,78 @@ public SymmetricKey() { } public string SecondaryKey { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct TwinAuthenticationType : System.IEquatable + public readonly partial struct TwinAuthenticationType : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public TwinAuthenticationType(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.TwinAuthenticationType CertificateAuthority { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.TwinAuthenticationType None { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.TwinAuthenticationType Sas { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.TwinAuthenticationType SelfSigned { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.TwinAuthenticationType other) { throw null; } + public static Azure.IoT.Hub.Service.Models.TwinAuthenticationType CertificateAuthority { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.TwinAuthenticationType None { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.TwinAuthenticationType Sas { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.TwinAuthenticationType SelfSigned { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.TwinAuthenticationType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.TwinAuthenticationType left, Azure.Iot.Hub.Service.Models.TwinAuthenticationType right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.TwinAuthenticationType (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.TwinAuthenticationType left, Azure.Iot.Hub.Service.Models.TwinAuthenticationType right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.TwinAuthenticationType left, Azure.IoT.Hub.Service.Models.TwinAuthenticationType right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.TwinAuthenticationType (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.TwinAuthenticationType left, Azure.IoT.Hub.Service.Models.TwinAuthenticationType right) { throw null; } public override string ToString() { throw null; } } public partial class TwinConfiguration { public TwinConfiguration() { } - public Azure.Iot.Hub.Service.Models.ConfigurationContent Content { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.ConfigurationContent Content { get { throw null; } set { } } public System.DateTimeOffset? CreatedTimeUtc { get { throw null; } set { } } public string Etag { get { throw null; } set { } } public string Id { get { throw null; } set { } } public System.Collections.Generic.IDictionary Labels { get { throw null; } } public System.DateTimeOffset? LastUpdatedTimeUtc { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.ConfigurationMetrics Metrics { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.ConfigurationMetrics Metrics { get { throw null; } set { } } public int? Priority { get { throw null; } set { } } public string SchemaVersion { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.ConfigurationMetrics SystemMetrics { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.ConfigurationMetrics SystemMetrics { get { throw null; } set { } } public string TargetCondition { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct TwinConnectionState : System.IEquatable + public readonly partial struct TwinConnectionState : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public TwinConnectionState(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.TwinConnectionState Connected { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.TwinConnectionState Disconnected { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.TwinConnectionState other) { throw null; } + public static Azure.IoT.Hub.Service.Models.TwinConnectionState Connected { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.TwinConnectionState Disconnected { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.TwinConnectionState other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.TwinConnectionState left, Azure.Iot.Hub.Service.Models.TwinConnectionState right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.TwinConnectionState (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.TwinConnectionState left, Azure.Iot.Hub.Service.Models.TwinConnectionState right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.TwinConnectionState left, Azure.IoT.Hub.Service.Models.TwinConnectionState right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.TwinConnectionState (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.TwinConnectionState left, Azure.IoT.Hub.Service.Models.TwinConnectionState right) { throw null; } public override string ToString() { throw null; } } public partial class TwinData { public TwinData() { } - public Azure.Iot.Hub.Service.Models.TwinAuthenticationType? AuthenticationType { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.DeviceCapabilities Capabilities { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.TwinAuthenticationType? AuthenticationType { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.DeviceCapabilities Capabilities { get { throw null; } set { } } public int? CloudToDeviceMessageCount { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.TwinConnectionState? ConnectionState { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.TwinConnectionState? ConnectionState { get { throw null; } set { } } public string DeviceEtag { get { throw null; } set { } } public string DeviceId { get { throw null; } set { } } public string DeviceScope { get { throw null; } set { } } public string Etag { get { throw null; } set { } } public System.DateTimeOffset? LastActivityTime { get { throw null; } set { } } public string ModuleId { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.TwinProperties Properties { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.TwinStatus? Status { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.TwinProperties Properties { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.TwinStatus? Status { get { throw null; } set { } } public string StatusReason { get { throw null; } set { } } public System.DateTimeOffset? StatusUpdateTime { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } public long? Version { get { throw null; } set { } } - public Azure.Iot.Hub.Service.Models.X509Thumbprint X509Thumbprint { get { throw null; } set { } } + public Azure.IoT.Hub.Service.Models.X509Thumbprint X509Thumbprint { get { throw null; } set { } } } public partial class TwinProperties { @@ -1002,21 +1002,21 @@ public TwinProperties() { } public System.Collections.Generic.IDictionary Reported { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct TwinStatus : System.IEquatable + public readonly partial struct TwinStatus : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; public TwinStatus(string value) { throw null; } - public static Azure.Iot.Hub.Service.Models.TwinStatus Disabled { get { throw null; } } - public static Azure.Iot.Hub.Service.Models.TwinStatus Enabled { get { throw null; } } - public bool Equals(Azure.Iot.Hub.Service.Models.TwinStatus other) { throw null; } + public static Azure.IoT.Hub.Service.Models.TwinStatus Disabled { get { throw null; } } + public static Azure.IoT.Hub.Service.Models.TwinStatus Enabled { get { throw null; } } + public bool Equals(Azure.IoT.Hub.Service.Models.TwinStatus other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.Iot.Hub.Service.Models.TwinStatus left, Azure.Iot.Hub.Service.Models.TwinStatus right) { throw null; } - public static implicit operator Azure.Iot.Hub.Service.Models.TwinStatus (string value) { throw null; } - public static bool operator !=(Azure.Iot.Hub.Service.Models.TwinStatus left, Azure.Iot.Hub.Service.Models.TwinStatus right) { throw null; } + public static bool operator ==(Azure.IoT.Hub.Service.Models.TwinStatus left, Azure.IoT.Hub.Service.Models.TwinStatus right) { throw null; } + public static implicit operator Azure.IoT.Hub.Service.Models.TwinStatus (string value) { throw null; } + public static bool operator !=(Azure.IoT.Hub.Service.Models.TwinStatus left, Azure.IoT.Hub.Service.Models.TwinStatus right) { throw null; } public override string ToString() { throw null; } } public partial class X509Thumbprint diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Azure.Security.KeyVault.Administration.csproj b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Azure.Security.KeyVault.Administration.csproj index f27531c6361c..92fc83e531a6 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Azure.Security.KeyVault.Administration.csproj +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Azure.Security.KeyVault.Administration.csproj @@ -33,10 +33,15 @@ - + + + + + + diff --git a/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/Azure.Security.KeyVault.Certificates.csproj b/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/Azure.Security.KeyVault.Certificates.csproj index 87391a6ab56c..cf56541a5fbc 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/Azure.Security.KeyVault.Certificates.csproj +++ b/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/Azure.Security.KeyVault.Certificates.csproj @@ -38,6 +38,12 @@ + + + + + + diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/Azure.Security.KeyVault.Keys.csproj b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/Azure.Security.KeyVault.Keys.csproj index b8761bffbd79..7cbfa10a46b2 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/Azure.Security.KeyVault.Keys.csproj +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/Azure.Security.KeyVault.Keys.csproj @@ -40,4 +40,10 @@ + + + + + + diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/Azure.Security.KeyVault.Secrets.csproj b/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/Azure.Security.KeyVault.Secrets.csproj index af5f1856a7ee..57f67abee418 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/Azure.Security.KeyVault.Secrets.csproj +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/Azure.Security.KeyVault.Secrets.csproj @@ -39,4 +39,10 @@ + + + + + + diff --git a/sdk/keyvault/Azure.Security.KeyVault.Shared/src/Azure.Security.KeyVault.Shared.projitems b/sdk/keyvault/Azure.Security.KeyVault.Shared/src/Azure.Security.KeyVault.Shared.projitems index 401a916ab1fa..a77390abc6b3 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Shared/src/Azure.Security.KeyVault.Shared.projitems +++ b/sdk/keyvault/Azure.Security.KeyVault.Shared/src/Azure.Security.KeyVault.Shared.projitems @@ -21,6 +21,5 @@ - \ No newline at end of file diff --git a/sdk/keyvault/Azure.Security.KeyVault.Shared/src/ChallengeBasedAuthenticationPolicy.cs b/sdk/keyvault/Azure.Security.KeyVault.Shared/src/ChallengeBasedAuthenticationPolicy.cs index 808b7d5c3311..fcfc4860d396 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Shared/src/ChallengeBasedAuthenticationPolicy.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Shared/src/ChallengeBasedAuthenticationPolicy.cs @@ -10,7 +10,7 @@ namespace Azure.Security.KeyVault { - internal class ChallengeBasedAuthenticationPolicy : BearerTokenChallengeAuthenticationPolicy + internal class ChallengeBasedAuthenticationPolicy : BearerTokenAuthenticationPolicy { private static ConcurrentDictionary _scopeCache = new ConcurrentDictionary(); private const string KeyVaultStashedContentKey = "KeyVaultContent"; @@ -19,8 +19,15 @@ internal class ChallengeBasedAuthenticationPolicy : BearerTokenChallengeAuthenti public ChallengeBasedAuthenticationPolicy(TokenCredential credential) : base(credential, Array.Empty()) { } - /// - protected override async Task AuthorizeRequestAsync(HttpMessage message, bool async) + /// + protected override ValueTask AuthorizeRequestAsync(HttpMessage message) + => AuthorizeRequestInternal(message, true); + + /// + protected override void AuthorizeRequest(HttpMessage message) + => AuthorizeRequestInternal(message, false).EnsureCompleted(); + + private async ValueTask AuthorizeRequestInternal(HttpMessage message, bool async) { if (message.Request.Uri.Scheme != Uri.UriSchemeHttps) { @@ -38,7 +45,14 @@ protected override async Task AuthorizeRequestAsync(HttpMessage message, bool as { // We fetched the scope from the cache, but we have not initialized the Scopes in the base yet. var context = new TokenRequestContext(_scope.Scopes, message.Request.ClientRequestId); - await SetAuthorizationHeader(message, context, async).ConfigureAwait(false); + if (async) + { + await AuthorizeRequestAsync(message, context).ConfigureAwait(false); + } + else + { + AuthorizeRequest(message, context); + } return; } @@ -54,7 +68,14 @@ protected override async Task AuthorizeRequestAsync(HttpMessage message, bool as } } - protected override async ValueTask AuthorizeRequestOnChallengeAsync(HttpMessage message, bool async) + /// + protected override ValueTask AuthorizeRequestOnChallengeAsync(HttpMessage message) + => AuthorizeRequestOnChallengeAsyncInternal(message, true); + + protected override bool AuthorizeRequestOnChallenge(HttpMessage message) + => AuthorizeRequestOnChallengeAsyncInternal(message, false).EnsureCompleted(); + + private async ValueTask AuthorizeRequestOnChallengeAsyncInternal(HttpMessage message, bool async) { if (message.Request.Content == null && message.TryGetProperty(KeyVaultStashedContentKey, out var content)) { @@ -86,7 +107,14 @@ protected override async ValueTask AuthorizeRequestOnChallengeAsync(HttpMe } var context = new TokenRequestContext(_scope.Scopes, message.Request.ClientRequestId); - await SetAuthorizationHeader(message, context, async).ConfigureAwait(false); + if (async) + { + await AuthorizeRequestAsync(message, context).ConfigureAwait(false); + } + else + { + AuthorizeRequest(message, context); + } return true; } @@ -97,6 +125,7 @@ internal AuthorityScope(string authrority, string[] scopes) Authority = authrority; Scopes = scopes; } + public string Authority { get; } public string[] Scopes { get; } diff --git a/sdk/keyvault/samples/sharelink/ShareLink.csproj b/sdk/keyvault/samples/sharelink/ShareLink.csproj index c8ae51eb9f37..2f3e11ad74e3 100644 --- a/sdk/keyvault/samples/sharelink/ShareLink.csproj +++ b/sdk/keyvault/samples/sharelink/ShareLink.csproj @@ -16,22 +16,32 @@ - + + + - - + + + + + + + + - + - - - + + + + + @@ -48,7 +58,6 @@ - diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/OperationAutoGenerated3.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/OperationAutoGenerated3.cs deleted file mode 100644 index 66a291ed9851..000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/OperationAutoGenerated3.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.Resources.Models -{ - /// Microsoft.Resources operation. - internal partial class OperationAutoGenerated3 - { - /// Initializes a new instance of OperationAutoGenerated3. - internal OperationAutoGenerated3() - { - } - - /// Operation name: {provider}/{resource}/{operation}. - public string Name { get; } - /// The object that represents the operation. - public OperationDisplayAutoGenerated3 Display { get; } - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/OperationDisplayAutoGenerated3.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/OperationDisplayAutoGenerated3.cs deleted file mode 100644 index b275f67c0c04..000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/OperationDisplayAutoGenerated3.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.Resources.Models -{ - /// The object that represents the operation. - internal partial class OperationDisplayAutoGenerated3 - { - /// Initializes a new instance of OperationDisplayAutoGenerated3. - internal OperationDisplayAutoGenerated3() - { - } - - /// Service provider: Microsoft.Resources. - public string Provider { get; } - /// Resource on which the operation is performed: Profile, endpoint, etc. - public string Resource { get; } - /// Operation type: Read, write, delete, etc. - public string Operation { get; } - /// Description of the operation. - public string Description { get; } - } -} diff --git a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/OperationListResultAutoGenerated3.cs b/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/OperationListResultAutoGenerated3.cs deleted file mode 100644 index c8023e3ceada..000000000000 --- a/sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/OperationListResultAutoGenerated3.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.Resources.Models -{ - /// Result of the request to list Microsoft.Resources operations. It contains a list of operations and a URL link to get the next set of results. - internal partial class OperationListResultAutoGenerated3 - { - /// Initializes a new instance of OperationListResultAutoGenerated3. - internal OperationListResultAutoGenerated3() - { - Value = new ChangeTrackingList(); - } - - /// List of Microsoft.Resources operations. - public IReadOnlyList Value { get; } - /// URL to get the next set of operation list results if there are any. - public string NextLink { get; } - } -} diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/samples/DeadLetterQueue/README.md b/sdk/servicebus/Azure.Messaging.ServiceBus/samples/DeadLetterQueue/README.md index 1e293955b964..5c0bd2c951b6 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/samples/DeadLetterQueue/README.md +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/samples/DeadLetterQueue/README.md @@ -46,7 +46,7 @@ In order to run the sample, you will need a Service Bus Namespace. For more info To build the sample: -1. Install [.NET Core 3.1](https://dot.net) or newer. +1. Install [.NET 5.0](https://dot.net) or newer. 2. Run in the project directory: diff --git a/sdk/testcommon/Azure.Graph.Rbac/src/autorest.md b/sdk/testcommon/Azure.Graph.Rbac/src/autorest.md index eb1a9f1aa100..de93d29bd32e 100644 --- a/sdk/testcommon/Azure.Graph.Rbac/src/autorest.md +++ b/sdk/testcommon/Azure.Graph.Rbac/src/autorest.md @@ -6,4 +6,5 @@ Run `dotnet build /t:GenerateCode` to generate code. azure-arm: true title: Rbac require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7fe24f57e1d0e3560535be0730db43feb3239a36/specification/graphrbac/data-plane/readme.md +skip-semantics-validation: true ```