openai/openai-dotnet

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
OpenAI_2.0.0-beta.1

Branches

Tags

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

Clone

HTTPS

Download ZIP

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

59lines · modecode

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