Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup the warnings that were supressed #22318

Merged
merged 5 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,25 @@ protected ApiVersionsBase(string value)
}

/// <summary>
///
/// Compares one <see cref="ApiVersionsBase"/> with another instance.
/// </summary>
/// <param name="left"></param>
/// <param name="right"></param>
/// <returns></returns>
/// <param name="left"> The object on the left side of the operator. </param>
/// <param name="right"> The object on the right side of the operator. </param>
/// <returns> True if the left object is less than the right. </returns>
public static bool operator <(ApiVersionsBase left, ApiVersionsBase right)
{
if (ReferenceEquals(null, left))
return !ReferenceEquals(null, right);

return left.CompareTo(right) == -1;
return ReferenceEquals(left, null) ? !ReferenceEquals(right, null) : left.CompareTo(right) < 0;
}

/// <summary>
///
/// Compares one <see cref="ApiVersionsBase"/> with another instance.
/// </summary>
/// <param name="left"></param>
/// <param name="right"></param>
/// <returns></returns>
/// <param name="left"> The object on the left side of the operator. </param>
/// <param name="right"> The object on the right side of the operator. </param>
/// <returns> True if the left object is greater than the right. </returns>
public static bool operator >(ApiVersionsBase left, ApiVersionsBase right)
{
if (ReferenceEquals(null, left))
return false;

return left.CompareTo(right) == 1;
return !ReferenceEquals(left, null) && left.CompareTo(right) > 0;
}

/// <summary>
Expand All @@ -69,47 +63,37 @@ public static implicit operator string(ApiVersionsBase version)
/// </summary>
/// <returns> API version value. </returns>
public virtual ResourceType ResourceType {get; }

/// <summary>
/// Overrides == operator for comparing ApiVersionsBase object with string object.
/// </summary>
/// <param name="first"> The ApiVersionsBase object to compare. </param>
/// <param name="second"> The API version value in string to compare. </param>
/// <param name="left"> The ApiVersionsBase object to compare. </param>
/// <param name="right"> The API version value in string to compare. </param>
/// <returns> Comparison result in boolean. Equal returns true otherwise returns false. </returns>
public static bool operator ==(ApiVersionsBase first, string second)
public static bool operator ==(ApiVersionsBase left, string right)
{
if (ReferenceEquals(null, first))
if (ReferenceEquals(null, left))
{
return ReferenceEquals(null, second);
return ReferenceEquals(null, right);
}

if (ReferenceEquals(null, second))
if (ReferenceEquals(null, right))
{
return false;
}

return first.Equals(second);
return left.Equals(right);
}

/// <summary>
/// Overrides != operator for comparing ApiVersionsBase object with string object.
/// </summary>
/// <param name="first"> The ApiVersionsBase object to compare. </param>
/// <param name="second"> The API version value in string to compare. </param>
/// <param name="left"> The ApiVersionsBase object to compare. </param>
/// <param name="right"> The API version value in string to compare. </param>
/// <returns> Comparison result in boolean. Equal returns false otherwise returns true. </returns>
public static bool operator !=(ApiVersionsBase first, string second)
public static bool operator !=(ApiVersionsBase left, string right)
{
if (ReferenceEquals(null, first))
{
return !ReferenceEquals(null, second);
}

if (ReferenceEquals(null, second))
{
return true;
}

return !first.Equals(second);
return !(left == right);
}

/// <summary>
Expand Down Expand Up @@ -205,5 +189,27 @@ public override int GetHashCode()
{
return _value.GetHashCode();
}

/// <summary>
/// Compares one <see cref="ApiVersionsBase"/> with another instance.
/// </summary>
/// <param name="left"> The object on the left side of the operator. </param>
/// <param name="right"> The object on the right side of the operator. </param>
/// <returns> True if the left object is less than or equal to the right. </returns>
public static bool operator <=(ApiVersionsBase left, ApiVersionsBase right)
{
return ReferenceEquals(left, null) || left.CompareTo(right) <= 0;
}

/// <summary>
/// Compares one <see cref="ApiVersionsBase"/> with another instance.
/// </summary>
/// <param name="left"> The object on the left side of the operator. </param>
/// <param name="right"> The object on the right side of the operator. </param>
/// <returns> True if the left object is greater than or equal to the right. </returns>
public static bool operator >=(ApiVersionsBase left, ApiVersionsBase right)
{
return ReferenceEquals(left, null) ? ReferenceEquals(right, null) : left.CompareTo(right) >= 0;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public ArmClient(TokenCredential credential, ArmClientOptions options = default)
/// <param name="defaultSubscriptionId"> The id of the default Azure subscription. </param>
/// <param name="credential"> A credential used to authenticate to an Azure Service. </param>
/// <param name="options"> The client parameters to use in these operations. </param>
/// <exception cref="ArgumentNullException"> If <see cref="TokenCredential"/> is null. </exception>
/// <exception cref="ArgumentNullException"> If <see cref="TokenCredential"/> is null. </exception>
public ArmClient(
string defaultSubscriptionId,
TokenCredential credential,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
This is a beta preview vesion. This version uses a next-generation code generator that introduces important breaking changes, but also new features (such as intuitive authentication, custom HTTP pipeline, distributed tracing and much more).
</Description>
<PackageTags>azure;management;resource</PackageTags>
<NoWarn>$(NoWarn);AZC0008;AZC0107;CA2214;CA1036;CA1067;CA1065;SA1028</NoWarn>
<NoWarn>$(NoWarn);CA2214</NoWarn>
<IncludeGeneratorSharedCode>true</IncludeGeneratorSharedCode>
</PropertyGroup>

<ItemGroup>
<Compile Include="$(AzureCoreSharedSources)ForwardsClientCallsAttribute.cs" Link="Shared\Core\%(RecursiveDir)\%(Filename)%(Extension)" />
<Compile Include="$(AzureCoreSharedSources)HashCodeBuilder.cs" Link="Shared\Core\%(RecursiveDir)\%(Filename)%(Extension)" />
</ItemGroup>

</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading