| | | 1 | | // Copyright (c) ZeroC, Inc. |
| | | 2 | | |
| | | 3 | | using System.ComponentModel; |
| | | 4 | | using ZeroC.Slice; |
| | | 5 | | |
| | | 6 | | namespace IceRpc.Slice; |
| | | 7 | | |
| | | 8 | | /// <summary>Represents an attribute that the Slice compiler uses to mark helper methods it generates on Service |
| | | 9 | | /// interfaces.</summary> |
| | | 10 | | [AttributeUsage(AttributeTargets.Method, Inherited = false)] |
| | | 11 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| | | 12 | | public sealed class SliceOperationAttribute : Attribute |
| | | 13 | | { |
| | | 14 | | /// <summary>Gets the operation name.</summary> |
| | | 15 | | /// <value>The operation name.</value> |
| | 0 | 16 | | public string Name { get; } |
| | | 17 | | |
| | | 18 | | /// <summary>Gets a value indicating whether the return value needs to be compressed.</summary> |
| | | 19 | | /// <value><see langword="true"/> if the return value needs to be compressed; otherwise, <see langword="false"/>. |
| | | 20 | | /// </value> |
| | 0 | 21 | | public bool CompressReturn { get; init; } |
| | | 22 | | |
| | | 23 | | /// <summary>Gets a value indicating whether the non-stream portion of the return value is pre-encoded by the |
| | | 24 | | /// application.</summary> |
| | | 25 | | /// <value><see langword="true"/> if the non-stream portion of the return value is pre-encoded; otherwise, |
| | | 26 | | /// <see langword="false"/>.</value> |
| | 0 | 27 | | public bool EncodedReturn { get; init; } |
| | | 28 | | |
| | | 29 | | /// <summary>Gets the exception specification of the operation.</summary> |
| | | 30 | | /// <value>An array of Slice exception types that the operation may throw.</value> |
| | | 31 | | /// <remarks>Slice1-only.</remarks> |
| | | 32 | | /// <seealso cref="SliceException"/> |
| | 0 | 33 | | public Type[] ExceptionSpecification { get; init; } = []; |
| | | 34 | | |
| | | 35 | | /// <summary>Gets a value indicating whether the operation is idempotent.</summary> |
| | | 36 | | /// <value><see langword="true"/> if the operation is idempotent; otherwise, <see langword="false"/>.</value> |
| | 0 | 37 | | public bool Idempotent { get; init; } |
| | | 38 | | |
| | | 39 | | /// <summary>Constructs a Slice operation attribute.</summary> |
| | | 40 | | /// <param name="name">The operation name.</param> |
| | 0 | 41 | | public SliceOperationAttribute(string name) => Name = name; |
| | | 42 | | } |