openai/openai-dotnet

Public

mirrored from https://github.com/openai/openai-dotnetAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
OpenAI_2.2.0-beta.2

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/Utility/Polyfill/System.Diagnostics.CodeAnalysis.ExperimentalAttribute.cs

60lines · modeblame

9f9f2936Jose Arriaga Maldonado2 years ago1#if !NET8_0_OR_GREATER
45fc4d72Stephen Toub2 years ago2#nullable enable
9f9f2936Jose Arriaga Maldonado2 years ago3
4// Licensed to the .NET Foundation under one or more agreements.
5// The .NET Foundation licenses this file to you under the MIT license.
6
7namespace System.Diagnostics.CodeAnalysis
8{
9/// <summary>
10/// Indicates that an API is experimental and it may change in the future.
11/// </summary>
12/// <remarks>
13/// This attribute allows call sites to be flagged with a diagnostic that indicates that an experimental
14/// feature is used. Authors can use this attribute to ship preview features in their assemblies.
15/// </remarks>
16[AttributeUsage(AttributeTargets.Assembly |
17AttributeTargets.Module |
18AttributeTargets.Class |
19AttributeTargets.Struct |
20AttributeTargets.Enum |
21AttributeTargets.Constructor |
22AttributeTargets.Method |
23AttributeTargets.Property |
24AttributeTargets.Field |
25AttributeTargets.Event |
26AttributeTargets.Interface |
27AttributeTargets.Delegate, Inherited = false)]
28internal sealed class ExperimentalAttribute : Attribute
29{
30/// <summary>
31/// Initializes a new instance of the <see cref="ExperimentalAttribute"/> class, specifying the ID that the compiler will use
32/// when reporting a use of the API the attribute applies to.
33/// </summary>
34/// <param name="diagnosticId">The ID that the compiler will use when reporting a use of the API the attribute applies to.</param>
35public ExperimentalAttribute(string diagnosticId)
36{
37DiagnosticId = diagnosticId;
38}
39
40/// <summary>
41/// Gets the ID that the compiler will use when reporting a use of the API the attribute applies to.
42/// </summary>
43/// <value>The unique diagnostic ID.</value>
44/// <remarks>
45/// The diagnostic ID is shown in build output for warnings and errors.
46/// <para>This property represents the unique ID that can be used to suppress the warnings or errors, if needed.</para>
47/// </remarks>
48public string DiagnosticId { get; }
49
50/// <summary>
51/// Gets or sets the URL for corresponding documentation.
52/// The API accepts a format string instead of an actual URL, creating a generic URL that includes the diagnostic ID.
53/// </summary>
54/// <value>The format string that represents a URL to corresponding documentation.</value>
55/// <remarks>An example format string is <c>https://contoso.com/obsoletion-warnings/{0}</c>.</remarks>
56public string? UrlFormat { get; set; }
57}
58}
59
60#endif // !NET8_0_OR_LATER