Skip to content

Commit 106aabf

Browse files
authored
add nullability to file used in autorest (Azure#23544)
* update namespace for model types update armclient to add new mgmttelemetrypolicy * remove props change and update api * use set value * enable nullable
1 parent 7290878 commit 106aabf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sdk/resourcemanager/Azure.ResourceManager/src/Shared/HttpMessageUtilities.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4+
#nullable enable
5+
46
using System;
57
using System.Reflection;
68
using System.Runtime.InteropServices;
@@ -12,7 +14,7 @@ internal static class HttpMessageUtilities
1214
{
1315
internal static readonly string PlatformInformation = $"({RuntimeInformation.FrameworkDescription}; {RuntimeInformation.OSDescription})";
1416

15-
private static string GetUserAgentName(string componentName, string componentVersion, string applicationId)
17+
private static string GetUserAgentName(string componentName, string componentVersion, string? applicationId)
1618
{
1719
string result;
1820
if (applicationId != null)
@@ -30,9 +32,9 @@ internal static string GetUserAgentName(object source, ClientOptions options)
3032
{
3133
const string PackagePrefix = "Azure.";
3234

33-
Assembly assembly = source.GetType().Assembly;
35+
Assembly assembly = source.GetType().Assembly!;
3436

35-
AssemblyInformationalVersionAttribute versionAttribute = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
37+
AssemblyInformationalVersionAttribute? versionAttribute = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
3638
if (versionAttribute == null)
3739
{
3840
throw new InvalidOperationException($"{nameof(AssemblyInformationalVersionAttribute)} is required on client SDK assembly '{assembly.FullName}' (inferred from the use of options type '{options.GetType().FullName}').");

0 commit comments

Comments
 (0)