forked from microsoft/typespec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update to cache method providers (microsoft#3611)
- Loading branch information
Showing
10 changed files
with
108 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...t-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/InputOperationKinds.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.ComponentModel; | ||
|
||
namespace Microsoft.Generator.CSharp.Input | ||
{ | ||
/// <summary> | ||
/// The kind of operation. | ||
/// </summary> | ||
public readonly partial struct InputOperationKinds : IEquatable<InputOperationKinds> | ||
{ | ||
internal const string DefaultValue = "Default"; | ||
internal const string LongRunningValue = "LongRunning"; | ||
internal const string PagingValue = "Paging"; | ||
|
||
private readonly string _value; | ||
|
||
/// <summary> Initializes a new instance of <see cref="InputOperationKinds"/>. </summary> | ||
/// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> | ||
public InputOperationKinds(string value) | ||
{ | ||
_value = value ?? throw new ArgumentNullException(nameof(value)); | ||
} | ||
|
||
/// <summary> | ||
/// Default operation kind. | ||
/// </summary> | ||
public static InputOperationKinds Default { get; } = new InputOperationKinds(DefaultValue); | ||
|
||
/// <summary> | ||
/// LongRunning operation kind. | ||
/// </summary> | ||
public static InputOperationKinds LongRunning { get; } = new InputOperationKinds(LongRunningValue); | ||
|
||
/// <summary> | ||
/// Paging operation kind. | ||
/// </summary> | ||
public static InputOperationKinds Paging { get; } = new InputOperationKinds(PagingValue); | ||
|
||
/// <summary> Determines if two <see cref="InputOperationKinds"/> values are the same. </summary> | ||
public static bool operator ==(InputOperationKinds left, InputOperationKinds right) => left.Equals(right); | ||
/// <summary> Determines if two <see cref="InputOperationKinds"/> values are not the same. </summary> | ||
public static bool operator !=(InputOperationKinds left, InputOperationKinds right) => !left.Equals(right); | ||
|
||
/// <summary> Converts a string to a <see cref="InputOperationKinds"/>.</summary> | ||
/// <param name="value">The string value to convert.</param> | ||
public static implicit operator InputOperationKinds(string value) => new(value); | ||
|
||
/// <inheritdoc /> | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
public override bool Equals(object? obj) => obj is InputOperationKinds other && Equals(other); | ||
|
||
/// <inheritdoc /> | ||
public bool Equals(InputOperationKinds other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); | ||
|
||
/// <inheritdoc/> | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
public override int GetHashCode() => _value?.GetHashCode() ?? 0; | ||
|
||
/// <inheritdoc /> | ||
public override string ToString() => _value; | ||
} | ||
} |
65 changes: 0 additions & 65 deletions
65
...client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/OperationKinds.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters