-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGoogle.Gemini.Models.GenerateContentRequestServiceTier.g.cs
More file actions
63 lines (60 loc) · 1.96 KB
/
Google.Gemini.Models.GenerateContentRequestServiceTier.g.cs
File metadata and controls
63 lines (60 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#nullable enable
namespace Google.Gemini
{
/// <summary>
/// Optional. The service tier of the request.
/// </summary>
public enum GenerateContentRequestServiceTier
{
/// <summary>
/// Flex service tier.
/// </summary>
Flex,
/// <summary>
/// Priority service tier.
/// </summary>
Priority,
/// <summary>
/// Standard service tier.
/// </summary>
Standard,
/// <summary>
/// Default service tier, which is standard.
/// </summary>
Unspecified,
}
/// <summary>
/// Enum extensions to do fast conversions without the reflection.
/// </summary>
public static class GenerateContentRequestServiceTierExtensions
{
/// <summary>
/// Converts an enum to a string.
/// </summary>
public static string ToValueString(this GenerateContentRequestServiceTier value)
{
return value switch
{
GenerateContentRequestServiceTier.Flex => "flex",
GenerateContentRequestServiceTier.Priority => "priority",
GenerateContentRequestServiceTier.Standard => "standard",
GenerateContentRequestServiceTier.Unspecified => "unspecified",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
/// <summary>
/// Converts an string to a enum.
/// </summary>
public static GenerateContentRequestServiceTier? ToEnum(string value)
{
return value switch
{
"flex" => GenerateContentRequestServiceTier.Flex,
"priority" => GenerateContentRequestServiceTier.Priority,
"standard" => GenerateContentRequestServiceTier.Standard,
"unspecified" => GenerateContentRequestServiceTier.Unspecified,
_ => null,
};
}
}
}