Skip to content

Commit

Permalink
fix(generator): enum docs doesn't follow value type (#5087)
Browse files Browse the repository at this point in the history
* fix(generator): enum docs doesn't follow value type

- fix hard-coded `string` in the docs of enum implicit conversion method
- refactor codes
- update unit test

fix #5069

---------

Co-authored-by: Mingzhe Huang (from Dev Box) <[email protected]>
  • Loading branch information
archerzz and Mingzhe Huang (from Dev Box) authored Sep 27, 2024
1 parent 83ef6a0 commit 5eb669d
Show file tree
Hide file tree
Showing 406 changed files with 415 additions and 414 deletions.
2 changes: 1 addition & 1 deletion samples/AnomalyDetector/src/Generated/Models/DataSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public DataSchema(string value)
public static bool operator ==(DataSchema left, DataSchema right) => left.Equals(right);
/// <summary> Determines if two <see cref="DataSchema"/> values are not the same. </summary>
public static bool operator !=(DataSchema left, DataSchema right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="DataSchema"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="DataSchema"/>. </summary>
public static implicit operator DataSchema(string value) => new DataSchema(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public FillNAMethod(string value)
public static bool operator ==(FillNAMethod left, FillNAMethod right) => left.Equals(right);
/// <summary> Determines if two <see cref="FillNAMethod"/> values are not the same. </summary>
public static bool operator !=(FillNAMethod left, FillNAMethod right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="FillNAMethod"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="FillNAMethod"/>. </summary>
public static implicit operator FillNAMethod(string value) => new FillNAMethod(value);

/// <inheritdoc />
Expand Down
2 changes: 1 addition & 1 deletion samples/AnomalyDetector/src/Generated/Models/ImputeMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public ImputeMode(string value)
public static bool operator ==(ImputeMode left, ImputeMode right) => left.Equals(right);
/// <summary> Determines if two <see cref="ImputeMode"/> values are not the same. </summary>
public static bool operator !=(ImputeMode left, ImputeMode right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="ImputeMode"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="ImputeMode"/>. </summary>
public static implicit operator ImputeMode(string value) => new ImputeMode(value);

/// <inheritdoc />
Expand Down
2 changes: 1 addition & 1 deletion samples/AppConfiguration/Generated/Models/Enum6.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Enum6(string value)
public static bool operator ==(Enum6 left, Enum6 right) => left.Equals(right);
/// <summary> Determines if two <see cref="Enum6"/> values are not the same. </summary>
public static bool operator !=(Enum6 left, Enum6 right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="Enum6"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="Enum6"/>. </summary>
public static implicit operator Enum6(string value) => new Enum6(value);

/// <inheritdoc />
Expand Down
2 changes: 1 addition & 1 deletion samples/AppConfiguration/Generated/Models/Enum7.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Enum7(string value)
public static bool operator ==(Enum7 left, Enum7 right) => left.Equals(right);
/// <summary> Determines if two <see cref="Enum7"/> values are not the same. </summary>
public static bool operator !=(Enum7 left, Enum7 right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="Enum7"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="Enum7"/>. </summary>
public static implicit operator Enum7(string value) => new Enum7(value);

/// <inheritdoc />
Expand Down
2 changes: 1 addition & 1 deletion samples/AppConfiguration/Generated/Models/Get5ItemsItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public Get5ItemsItem(string value)
public static bool operator ==(Get5ItemsItem left, Get5ItemsItem right) => left.Equals(right);
/// <summary> Determines if two <see cref="Get5ItemsItem"/> values are not the same. </summary>
public static bool operator !=(Get5ItemsItem left, Get5ItemsItem right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="Get5ItemsItem"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="Get5ItemsItem"/>. </summary>
public static implicit operator Get5ItemsItem(string value) => new Get5ItemsItem(value);

/// <inheritdoc />
Expand Down
2 changes: 1 addition & 1 deletion samples/AppConfiguration/Generated/Models/Get6ItemsItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Get6ItemsItem(string value)
public static bool operator ==(Get6ItemsItem left, Get6ItemsItem right) => left.Equals(right);
/// <summary> Determines if two <see cref="Get6ItemsItem"/> values are not the same. </summary>
public static bool operator !=(Get6ItemsItem left, Get6ItemsItem right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="Get6ItemsItem"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="Get6ItemsItem"/>. </summary>
public static implicit operator Get6ItemsItem(string value) => new Get6ItemsItem(value);

/// <inheritdoc />
Expand Down
2 changes: 1 addition & 1 deletion samples/AppConfiguration/Generated/Models/Get7ItemsItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Get7ItemsItem(string value)
public static bool operator ==(Get7ItemsItem left, Get7ItemsItem right) => left.Equals(right);
/// <summary> Determines if two <see cref="Get7ItemsItem"/> values are not the same. </summary>
public static bool operator !=(Get7ItemsItem left, Get7ItemsItem right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="Get7ItemsItem"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="Get7ItemsItem"/>. </summary>
public static implicit operator Get7ItemsItem(string value) => new Get7ItemsItem(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public Head5ItemsItem(string value)
public static bool operator ==(Head5ItemsItem left, Head5ItemsItem right) => left.Equals(right);
/// <summary> Determines if two <see cref="Head5ItemsItem"/> values are not the same. </summary>
public static bool operator !=(Head5ItemsItem left, Head5ItemsItem right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="Head5ItemsItem"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="Head5ItemsItem"/>. </summary>
public static implicit operator Head5ItemsItem(string value) => new Head5ItemsItem(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Head6ItemsItem(string value)
public static bool operator ==(Head6ItemsItem left, Head6ItemsItem right) => left.Equals(right);
/// <summary> Determines if two <see cref="Head6ItemsItem"/> values are not the same. </summary>
public static bool operator !=(Head6ItemsItem left, Head6ItemsItem right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="Head6ItemsItem"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="Head6ItemsItem"/>. </summary>
public static implicit operator Head6ItemsItem(string value) => new Head6ItemsItem(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Head7ItemsItem(string value)
public static bool operator ==(Head7ItemsItem left, Head7ItemsItem right) => left.Equals(right);
/// <summary> Determines if two <see cref="Head7ItemsItem"/> values are not the same. </summary>
public static bool operator !=(Head7ItemsItem left, Head7ItemsItem right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="Head7ItemsItem"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="Head7ItemsItem"/>. </summary>
public static implicit operator Head7ItemsItem(string value) => new Head7ItemsItem(value);

/// <inheritdoc />
Expand Down
2 changes: 1 addition & 1 deletion samples/Azure.AI.FormRecognizer/Generated/Models/Enum1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public Enum1(string value)
public static bool operator ==(Enum1 left, Enum1 right) => left.Equals(right);
/// <summary> Determines if two <see cref="Enum1"/> values are not the same. </summary>
public static bool operator !=(Enum1 left, Enum1 right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="Enum1"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="Enum1"/>. </summary>
public static implicit operator Enum1(string value) => new Enum1(value);

/// <inheritdoc />
Expand Down
2 changes: 1 addition & 1 deletion samples/Azure.AI.FormRecognizer/Generated/Models/Enum2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public Enum2(string value)
public static bool operator ==(Enum2 left, Enum2 right) => left.Equals(right);
/// <summary> Determines if two <see cref="Enum2"/> values are not the same. </summary>
public static bool operator !=(Enum2 left, Enum2 right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="Enum2"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="Enum2"/>. </summary>
public static implicit operator Enum2(string value) => new Enum2(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Language(string value)
public static bool operator ==(Language left, Language right) => left.Equals(right);
/// <summary> Determines if two <see cref="Language"/> values are not the same. </summary>
public static bool operator !=(Language left, Language right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="Language"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="Language"/>. </summary>
public static implicit operator Language(string value) => new Language(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public DdosSettingsProtectionCoverage(string value)
public static bool operator ==(DdosSettingsProtectionCoverage left, DdosSettingsProtectionCoverage right) => left.Equals(right);
/// <summary> Determines if two <see cref="DdosSettingsProtectionCoverage"/> values are not the same. </summary>
public static bool operator !=(DdosSettingsProtectionCoverage left, DdosSettingsProtectionCoverage right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="DdosSettingsProtectionCoverage"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="DdosSettingsProtectionCoverage"/>. </summary>
public static implicit operator DdosSettingsProtectionCoverage(string value) => new DdosSettingsProtectionCoverage(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public EffectiveRouteSource(string value)
public static bool operator ==(EffectiveRouteSource left, EffectiveRouteSource right) => left.Equals(right);
/// <summary> Determines if two <see cref="EffectiveRouteSource"/> values are not the same. </summary>
public static bool operator !=(EffectiveRouteSource left, EffectiveRouteSource right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="EffectiveRouteSource"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="EffectiveRouteSource"/>. </summary>
public static implicit operator EffectiveRouteSource(string value) => new EffectiveRouteSource(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public EffectiveRouteState(string value)
public static bool operator ==(EffectiveRouteState left, EffectiveRouteState right) => left.Equals(right);
/// <summary> Determines if two <see cref="EffectiveRouteState"/> values are not the same. </summary>
public static bool operator !=(EffectiveRouteState left, EffectiveRouteState right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="EffectiveRouteState"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="EffectiveRouteState"/>. </summary>
public static implicit operator EffectiveRouteState(string value) => new EffectiveRouteState(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public EffectiveSecurityRuleProtocol(string value)
public static bool operator ==(EffectiveSecurityRuleProtocol left, EffectiveSecurityRuleProtocol right) => left.Equals(right);
/// <summary> Determines if two <see cref="EffectiveSecurityRuleProtocol"/> values are not the same. </summary>
public static bool operator !=(EffectiveSecurityRuleProtocol left, EffectiveSecurityRuleProtocol right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="EffectiveSecurityRuleProtocol"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="EffectiveSecurityRuleProtocol"/>. </summary>
public static implicit operator EffectiveSecurityRuleProtocol(string value) => new EffectiveSecurityRuleProtocol(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public IPAllocationMethod(string value)
public static bool operator ==(IPAllocationMethod left, IPAllocationMethod right) => left.Equals(right);
/// <summary> Determines if two <see cref="IPAllocationMethod"/> values are not the same. </summary>
public static bool operator !=(IPAllocationMethod left, IPAllocationMethod right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="IPAllocationMethod"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="IPAllocationMethod"/>. </summary>
public static implicit operator IPAllocationMethod(string value) => new IPAllocationMethod(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public IPVersion(string value)
public static bool operator ==(IPVersion left, IPVersion right) => left.Equals(right);
/// <summary> Determines if two <see cref="IPVersion"/> values are not the same. </summary>
public static bool operator !=(IPVersion left, IPVersion right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="IPVersion"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="IPVersion"/>. </summary>
public static implicit operator IPVersion(string value) => new IPVersion(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public LoadBalancerOutboundRuleProtocol(string value)
public static bool operator ==(LoadBalancerOutboundRuleProtocol left, LoadBalancerOutboundRuleProtocol right) => left.Equals(right);
/// <summary> Determines if two <see cref="LoadBalancerOutboundRuleProtocol"/> values are not the same. </summary>
public static bool operator !=(LoadBalancerOutboundRuleProtocol left, LoadBalancerOutboundRuleProtocol right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="LoadBalancerOutboundRuleProtocol"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="LoadBalancerOutboundRuleProtocol"/>. </summary>
public static implicit operator LoadBalancerOutboundRuleProtocol(string value) => new LoadBalancerOutboundRuleProtocol(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public LoadBalancerSkuName(string value)
public static bool operator ==(LoadBalancerSkuName left, LoadBalancerSkuName right) => left.Equals(right);
/// <summary> Determines if two <see cref="LoadBalancerSkuName"/> values are not the same. </summary>
public static bool operator !=(LoadBalancerSkuName left, LoadBalancerSkuName right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="LoadBalancerSkuName"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="LoadBalancerSkuName"/>. </summary>
public static implicit operator LoadBalancerSkuName(string value) => new LoadBalancerSkuName(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public LoadDistribution(string value)
public static bool operator ==(LoadDistribution left, LoadDistribution right) => left.Equals(right);
/// <summary> Determines if two <see cref="LoadDistribution"/> values are not the same. </summary>
public static bool operator !=(LoadDistribution left, LoadDistribution right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="LoadDistribution"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="LoadDistribution"/>. </summary>
public static implicit operator LoadDistribution(string value) => new LoadDistribution(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public ProbeProtocol(string value)
public static bool operator ==(ProbeProtocol left, ProbeProtocol right) => left.Equals(right);
/// <summary> Determines if two <see cref="ProbeProtocol"/> values are not the same. </summary>
public static bool operator !=(ProbeProtocol left, ProbeProtocol right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="ProbeProtocol"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="ProbeProtocol"/>. </summary>
public static implicit operator ProbeProtocol(string value) => new ProbeProtocol(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public ProvisioningState(string value)
public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right);
/// <summary> Determines if two <see cref="ProvisioningState"/> values are not the same. </summary>
public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="ProvisioningState"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="ProvisioningState"/>. </summary>
public static implicit operator ProvisioningState(string value) => new ProvisioningState(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public PublicIPAddressSkuName(string value)
public static bool operator ==(PublicIPAddressSkuName left, PublicIPAddressSkuName right) => left.Equals(right);
/// <summary> Determines if two <see cref="PublicIPAddressSkuName"/> values are not the same. </summary>
public static bool operator !=(PublicIPAddressSkuName left, PublicIPAddressSkuName right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="PublicIPAddressSkuName"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="PublicIPAddressSkuName"/>. </summary>
public static implicit operator PublicIPAddressSkuName(string value) => new PublicIPAddressSkuName(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public RouteNextHopType(string value)
public static bool operator ==(RouteNextHopType left, RouteNextHopType right) => left.Equals(right);
/// <summary> Determines if two <see cref="RouteNextHopType"/> values are not the same. </summary>
public static bool operator !=(RouteNextHopType left, RouteNextHopType right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="RouteNextHopType"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="RouteNextHopType"/>. </summary>
public static implicit operator RouteNextHopType(string value) => new RouteNextHopType(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public SecurityRuleAccess(string value)
public static bool operator ==(SecurityRuleAccess left, SecurityRuleAccess right) => left.Equals(right);
/// <summary> Determines if two <see cref="SecurityRuleAccess"/> values are not the same. </summary>
public static bool operator !=(SecurityRuleAccess left, SecurityRuleAccess right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="SecurityRuleAccess"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="SecurityRuleAccess"/>. </summary>
public static implicit operator SecurityRuleAccess(string value) => new SecurityRuleAccess(value);

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public SecurityRuleDirection(string value)
public static bool operator ==(SecurityRuleDirection left, SecurityRuleDirection right) => left.Equals(right);
/// <summary> Determines if two <see cref="SecurityRuleDirection"/> values are not the same. </summary>
public static bool operator !=(SecurityRuleDirection left, SecurityRuleDirection right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="SecurityRuleDirection"/>. </summary>
/// <summary> Converts a <see cref="string"/> to a <see cref="SecurityRuleDirection"/>. </summary>
public static implicit operator SecurityRuleDirection(string value) => new SecurityRuleDirection(value);

/// <inheritdoc />
Expand Down
Loading

0 comments on commit 5eb669d

Please sign in to comment.